Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility Issue with sigs.k8s.io/structured-merge-diff/v4 Upgrade #267

Closed
animesh-sri-98 opened this issue Nov 4, 2024 · 7 comments
Closed

Comments

@animesh-sri-98
Copy link

animesh-sri-98 commented Nov 4, 2024

When I run go get -u, followed by go mod tidy and go mod vendor, I encounter a compatibility issue that breaks my build due to an unexpected field in merge.Updater. Specifically, this occurs after go get -u upgrades sigs.k8s.io/structured-merge-diff/v4 from version v4.4.1 to v4.4.2. Here’s the error message:

image

Here is my go.mod file, showing key dependencies:

module <name_of_my_project>

go 1.23.2

require (
	github.com/agiledragon/gomonkey/v2 v2.12.0
	github.com/jstemmer/go-junit-report/v2 v2.1.0
	github.com/prometheus/client_golang v1.20.5
	github.com/prometheus/client_model v0.6.1
	github.com/stretchr/testify v1.9.0
	k8s.io/apimachinery v0.31.2
	k8s.io/client-go v0.31.2
)

require (
	github.com/beorn7/perks v1.0.1 // indirect
	github.com/cespare/xxhash/v2 v2.3.0 // indirect
	github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
	github.com/emicklei/go-restful/v3 v3.12.1 // indirect
	github.com/fxamacker/cbor/v2 v2.7.0 // indirect
	github.com/go-logr/logr v1.4.2 // indirect
	github.com/go-openapi/jsonpointer v0.21.0 // indirect
	github.com/go-openapi/jsonreference v0.21.0 // indirect
	github.com/go-openapi/swag v0.23.0 // indirect
	github.com/gogo/protobuf v1.3.2 // indirect
	github.com/golang/protobuf v1.5.4 // indirect
	github.com/google/gnostic-models v0.6.8 // indirect
	github.com/google/go-cmp v0.6.0 // indirect
	github.com/google/gofuzz v1.2.0 // indirect
	github.com/google/uuid v1.6.0 // indirect
	github.com/josharian/intern v1.0.0 // indirect
	github.com/json-iterator/go v1.1.12 // indirect
	github.com/klauspost/compress v1.17.11 // indirect
	github.com/mailru/easyjson v0.7.7 // indirect
	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
	github.com/modern-go/reflect2 v1.0.2 // indirect
	github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
	github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
	github.com/prometheus/common v0.60.0 // indirect
	github.com/prometheus/procfs v0.15.1 // indirect
	github.com/x448/float16 v0.8.4 // indirect
	golang.org/x/net v0.30.0 // indirect
	golang.org/x/oauth2 v0.23.0 // indirect
	golang.org/x/sys v0.26.0 // indirect
	golang.org/x/term v0.25.0 // indirect
	golang.org/x/text v0.19.0 // indirect
	golang.org/x/time v0.7.0 // indirect
	google.golang.org/protobuf v1.35.1 // indirect
	gopkg.in/inf.v0 v0.9.1 // indirect
	gopkg.in/yaml.v2 v2.4.0 // indirect
	gopkg.in/yaml.v3 v3.0.1 // indirect
	k8s.io/api v0.31.2 // indirect
	k8s.io/klog/v2 v2.130.1 // indirect
	k8s.io/kube-openapi v0.0.0-20241009091222-67ed5848f094 // indirect
	k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 // indirect
	sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
	sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
	sigs.k8s.io/yaml v1.4.0 // indirect
)

It seems the new version (v4.4.2) introduces a change that k8s.io/apimachinery doesn’t yet accommodate. Is there a recommended workaround for this issue, or an update to k8s.io/apimachinery planned to support this new version? Can someone please help?
@jpbetz @apelisse @AnishShah @Jefftree @yliaog @cici37

@cici37
Copy link

cici37 commented Nov 4, 2024

Hi @animesh-sri-98 , the version of structured-merge-diff repo in k/k has been bumped to the latest version v4.4.2 through kubernetes/kubernetes#128416. Have you fetched and rebased on the latest change?

@cici37
Copy link

cici37 commented Nov 4, 2024

And the PR mentioned above contained the apimachinery updates to accommodate the latest changes in sturctured-merge-diff

@animesh-sri-98
Copy link
Author

animesh-sri-98 commented Nov 4, 2024

@cici37 I executed go clean -modcache followed by go get -u and go mod graph and can see the following:

image

All of these are being resolved to v4.4.1 instead of v4.4.2. This is probably due to a dependency conflict as k8s.io/kube-openapi references sigs.k8s.io/structured-merge-diff/v4@v4.4.1 in its go.mod file, while k8s.io/client-go and k8s.io/apimachinery mention v4.4.2 in go.mod. Could you suggest something here?

I have also raised an issue in the kubernetes/kube-openapi repo to test it with v4.4.2 and update the go.mod file.

@cici37
Copy link

cici37 commented Nov 5, 2024

In which repo are you running against where this issue appears?
structured-merge-diff cut v4.4.2 release and the new release was updated in the lates k/k which will be released along with the upcoming k8s release. If you are working on k/k, there should be no dependency issue expected. If you are working on your own repo which imports k8s.io, I could suggest either use the earlier version which all depends on structured-merge-diff@v4.4.1 or get the latest changes which has the structured-merge-diff version bump.

In the screenshot you shared, all the k8s.io dependency you imported are at 0.31.2 which should all depend on structured-merge-diff@v4.4.1 as expected.
ref link

@jpbetz
Copy link
Contributor

jpbetz commented Nov 5, 2024

I've merged kubernetes/kube-openapi#516 to kube-openapi to update the version. I'll do the same for the main Kubernetes repo. This way all the versions in the dep tree will be the same for the Kubernetes 1.32 release

@jpbetz
Copy link
Contributor

jpbetz commented Nov 5, 2024

I've opened kubernetes/kubernetes#128580 to bump the kubernetes version.

@jpbetz
Copy link
Contributor

jpbetz commented Nov 5, 2024

Fixed by kubernetes/kube-openapi#516 and kubernetes/kubernetes#128580, both of which have merged.

@jpbetz jpbetz closed this as completed Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants