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

Not possible to use cluster-node-tuning-operator as a dependency because of its go.mod containing non existing references

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • 4.13, 4.12, 4.14, 4.15, 4.16, 4.17, 4.18, 4.19, 4.20
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In Clusters Service (part of OCM) we make use of the https://github.com/openshift/cluster-node-tuning-operator library.

       

      In our repository we are currently referencing github.com/openshift/cluster-node-tuning-operator as a dependency in our go.mod. Specifically, we have the following commit being specified:

      github.com/openshift/cluster-node-tuning-operator v0.0.0-20220614214129-2c76314fb3cc
      

       

      We have detected that parts of the Go tooling fail when the github.com/openshift/cluster-node-tuning-operator dependency is specified in our go.mod, and the reason is due to github.com/openshift/cluster-node-tuning-operator having in its go.mod dependencies pointing to git tag references that do not exist. This occurs even when the go.mod of the github.com/openshift/cluster-node-tuning-operator dependency itself has a replace to an existing git tag

      • This can be reproduced by doing the following:
        Create your own git repository
      • Initialize go.mod and specify github.com/openshift/cluster-node-tuning-operator as a dependency. This can be done pointing to the same commit that I mentioned above, or even pointing to the commit of the current `main` branch
      • Run the `go list -m -json all` command. Observe how it fails with an error indicating that there's an unknown revision of one of the dependencies specified. In case it helps for something, we are using Go 1.24 in our project.

      In the case of the dependency we have specified, when we run the `go list -m -json all` command, we get the following error:

      msoriano@localhost:~/go/src/... (master)(ocm:?)$ go list -m -json all 
      go: k8s.io/kubernetes@v0.23.3: invalid version: unknown revision v0.23.3
      

       

      The reason is because the tag v0.23.3 of the k8s.io/kubernetes does not exist. You will notice though that in github.com/openshift/cluster-node-tuning-operator v0.0.0-20220614214129-2c76314fb3cc in its go.mod that's specified, but also a `replace` that points to a correctly existing git tag reference:

      k8s.io/kubernetes => k8s.io/kubernetes v1.23.3

      However, this does still produce the error I mentioned when using some parts of the Go tooling. This is particularly relevant because some IDEs like goland make use of parts of the Go tooling that end up hitting the error.

      This prevents us and developers from using the dependency in our project. This impacts anyone that might reference this library as a dependency.

      We have also tried to update our dependency to the current commit in the `main` branch, but the same error is reproduced, now pointing to other non existent dependencies git tags. When trying to update the dependency to the `main` branch the following can be observed:

      $ go get -v github.com/openshift/cluster-node-tuning-operator@main
      ...
      go: github.com/openshift/cluster-node-tuning-operator@main (v0.0.0-20250529140854-b2c146e566da) requires k8s.io/kube-openapi@v0.32.3: reading k8s.io/kube-openapi/go.mod at revision v0.32.3: unknown revision v0.32.3

       

      We have also tried to use the version of branches `release-4.12` to `release-4.21` and all of them contain the same issue about a reference to non existing git tags in the go.mod.

      We understand that one way to fix this would be to update the go.mod of the cluster-node-tuning-operator repository to not contain non existing references, not even on the "require" section even when they have a replace in that same go.mod.

      Additionally and independently, there seems to be another aspect that could be improved, which is that we noticed that k8s.io/kubernetes is referenced as a dependency, but according to that project itself, referencing it as a library is unsupported and specific components should be referenced instead. This is explained here https://github.com/kubernetes/kubernetes?tab=readme-ov-file#to-start-using-k8s. This is something else that could be improved, but the biggest issue is the one about references to non existing git tags.

       

       

      I reported this same issue directly in github before: https://github.com/openshift/cluster-node-tuning-operator/issues/1331

      and I also submitted a PR in the repository with an attempt to fix the described issue: https://github.com/openshift/cluster-node-tuning-operator/pull/1332

       

      Thanks.

              msivak@redhat.com Martin Sivak
              msorianod Miguel Soriano
              None
              None
              Mallapadi Niranjan Mallapadi Niranjan
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: