client-go: Package upgrade blocked

Please refer to the command and its output below:

go get -u ./...

# k8s.io/client-go/applyconfigurations/meta/v1
/go/pkg/mod/k8s.io/client-go@v0.23.5/applyconfigurations/meta/v1/unstructured.go:64:37: cannot use doc (type *"github.com/googleapis/gnostic/openapiv2".Document) as type *"github.com/google/gnostic/openapiv2".Document in argument to "k8s.io/kube-openapi/pkg/util/proto".NewOpenAPIData

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 25
  • Comments: 20 (6 by maintainers)

Commits related to this issue

Most upvoted comments

i was able to fix this by replacing the k8s.io/kube-openapi entry in the go.mod in my project with this:

k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect

go get -u ./... is not likely to work seamlessly with v0 modules, which includes client-go and many of its dependencies (including gnostic, mergo, and others).

client-go is tested with the versions of dependencies referenced from its go.mod file, but newer versions of v0… dependencies may or may not work correctly with client-go

When client-go v0.28.x is released (~August 2023), this specific conflict between gnostic and gnostic-models will be resolved.

/close

Same problem here, updating all deps through go get -u doesn’t work.

update to v0.24.0-alpha.4, it helped me

Adding this to my go.mod fixed some of the openapi type errors I was running into:

replace (
    github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.5.5
)

Same here, but I think it already got resolved in an upcoming version:

Here the correct pkg gets imported: https://github.com/kubernetes/client-go/blob/v0.24.0-alpha.4/discovery/discovery_client.go#L32