Skip to content

Update to new golang (at least 1.23) and refreshed dependencies #2

@jdstrand

Description

@jdstrand

Prior to the creation of the community maintained fork, I created influxdata/telegraf-operator#155 as a jumping off point to update telegraf-operator to use golang 1.24 with some refreshed dependencies.

telegraf-operator currently specifies go 1.18 in go.mod, but recent golang.org/x/net requires golang 1.23. In updating telegraf-operator to golang 1.24, many changes were required to make go vet happy, allow code to compile, etc. That PR does quite a few things:

  • go.mod:
    • updates to go 1.24
    • updates github.com/kudobuilder/kuttl to v0.22.0 (to work with newer github.com/docker/docker)
    • updates sigs.k8s.io/controller-runtime to v0.20.4 (needed for newer toolchain)
  • updates handler.go for go vet
  • updates handler_test.go for go vet and newer sigs.k8s.io/controller-runtime
  • updates main.go for newer sigs.k8s.io/controller-runtime
  • updates sidecar_test.go for newer github.com/kudobuilder/kuttl
  • updates Makefile to use sigs.k8s.io/controller-tools/cmd/controller-gen@v0.17.2, needed for the above
  • updates Makefile to use crd:crdVersions=v1 instead of crd:trivialVersions=true, needed for sigs.k8s.io/controller-tools/cmd/controller-gen@v0.17.2 (IMPORTANT: this remove v1beta)

Once I ran go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.17.2 to update ~/go/bin/controller-gen, with the above changes, it builds. Yay! BUT, the testsuite fails, presumably because of the CRD changes from the upgrade to sigs.k8s.io/controller-tools/cmd/controller-gen@v0.17.2.

influxdata/telegraf-operator#155 is unreviewed, untested and I don't plan to continue working on the PR, but hopefully it can provide a jumping off point for this community fork. (Note, the https://github.com/InfluxCommunity/telegraf-operator/tree/jdstrand/update-to-go1.24 branch in this repo was imported from influxdata/telegraf-operator#155)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions