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

Cloud controller manager operator can fail when running goimports through fmt make target

XMLWordPrintable

    • Moderate
    • None
    • False
    • Hide

      None

      Show
      None
    • Release Note Not Required
    • In Progress

      This is a clone of issue OCPBUGS-43389. The following is the description of the original issue:

      This is a clone of issue OCPBUGS-43157. The following is the description of the original issue:

      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.

            joelspeed Joel Speed
            openshift-crt-jira-prow OpenShift Prow Bot
            Zhaohua Sun Zhaohua Sun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: