Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-43164

Cloud controller manager operator can fail when running goimports make target

XMLWordPrintable

    • Moderate
    • None
    • False
    • Hide

      None

      Show
      None
    • Release Note Not Required
    • In Progress

      Description of problem:

          When running the `make fmt` target in the repository the command can fail due to a mismatch of versions between the go language and the goimports dependency.

       

      Version-Release number of selected component (if applicable):

          4.16.z

      How reproducible:

          always

      Steps to Reproduce:

          1.checkout release-4.16 branch
          2.run `make fmt`
          

      Actual results:

      INFO[2024-10-01T14:41:15Z] make fmt make[1]: Entering directory '/go/src/github.com/openshift/cluster-cloud-controller-manager-operator' hack/goimports.sh go: downloading golang.org/x/tools v0.25.0 go: golang.org/x/tools/cmd/goimports@latest: golang.org/x/tools@v0.25.0 requires go >= 1.22.0 (running go 1.21.11; GOTOOLCHAIN=local) 

      Expected results:

          successful completion of `make fmt`

      Additional info:

          our goimports.sh script file reference `goimports@latest` which means that this problem will most likely affect older branches as well. we will need to set a specific version of the goimports package for those branches.
      
      given that the CCCMO includes golangci-lint, and uses it for a test, we should include goimports through golangci-lint which will solve this problem without needing special versions of goimports.

              mimccune@redhat.com Michael McCune
              mimccune@redhat.com Michael McCune
              Zhaohua Sun Zhaohua Sun
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: