rancher / renovate-config

3 stars 6 forks source link

Renovate is unable to bump k8s go libraries without user interaction #270

Open thardeck opened 5 months ago

thardeck commented 5 months ago

Renovate is unable to bump k8s libraries and does even realize that itself but still creates the pr. It reports:

...
go: downloading sigs.k8s.io/kustomize/kyaml v0.17.0
go: downloading sigs.k8s.io/kustomize v2.0.3+incompatible
go: github.com/rancher/fleet/internal/cmd/controller/imagescan/update imports
    sigs.k8s.io/kustomize/kyaml/setters2: cannot find module providing package sigs.k8s.io/kustomize/kyaml/setters2
go: github.com/rancher/fleet/cmd/codegen imports
    github.com/rancher/wrangler/v2/pkg/controller-gen/args imports
    k8s.io/code-generator/cmd/client-gen/path: cannot find module providing package k8s.io/code-generator/cmd/client-gen/path

This is the according pr: https://github.com/rancher/fleet/pull/2328


A similar issue is that renovate bumps k8s.io/kubernetes to v1.29.4 as security fix but does not bump the other k8s libraries which most likely is the reason for failing CI tests. Our unit tests report the following failures:

 # k8s.io/kubernetes/pkg/features
Error: ../../../go/pkg/mod/k8s.io/kubernetes@v1.29.4/pkg/features/kube_features.go:1266:18: undefined: genericfeatures.SeparateCacheWatchRPC
Error: ../../../go/pkg/mod/k8s.io/kubernetes@v1.29.4/pkg/features/kube_features.go:1278:18: undefined: genericfeatures.WatchFromStorageWithoutResourceVersion

This is the according pr: https://github.com/rancher/fleet/pull/2362


The solution would most likely be when for example kubernetes is bumped to 1.29.4, that all other k8s libraries are also bumped to 0.29.4 to keep them in sync.

I have not manually tested it in this case, but this is what I do when I bump these libraries on my own.

pjbgf commented 5 months ago

@thardeck thanks for creating this issue.

These might be slightly different issues from an initial check.

On the first PR, it seems that it failed to correctly update the pseudo version as the resulting version is not correctly formatted:

sigs.k8s.io/kustomize/api 2e6171a9ea9a
sigs.k8s.io/kustomize/kyaml 2e6171a9ea9a

On the second, the issue was that the k8s.io/apiserver was not bumped, and was kept at v0.29.2. This should be done automatically as part of goModTidy. :thinking:

thardeck commented 5 months ago

Many thanks for looking into it so quickly.

These might be slightly different issues from an initial check.

Should I create a different issue for the second one or leave it like this?

@thardeck thanks for creating this issue.

These might be slightly different issues from an initial check.

On the first PR, it seems that it failed to correctly update the pseudo version as the resulting version is not correctly formatted:

sigs.k8s.io/kustomize/api 2e6171a9ea9a
sigs.k8s.io/kustomize/kyaml 2e6171a9ea9a

On the second, the issue was that the k8s.io/apiserver was not bumped, and was kept at v0.29.2. This should be done automatically as part of goModTidy. 🤔

Running go mod tidy should not change anything because our CI runs it and complains if there are any changes different from the pr.

pjbgf commented 5 months ago

Happy to leave as is. I think the second part of this issue may be tackled under https://github.com/rancher/renovate-config/issues/271, as I suspect they may have the same root cause. If not, we can create another issue at a later stage.

thardeck commented 5 months ago

On the second, the issue was that the k8s.io/apiserver was not bumped, and was kept at v0.29.2. This should be done automatically as part of goModTidy. 🤔

As expected I manually had to bump the k8s libraries to get the tests green: https://github.com/rancher/fleet/pull/2362/commits/d9ca814a01532226fc9e2d05bedadaffa4a064d7

It can not be done by just using go mod tidy.