gnostic icon indicating copy to clipboard operation
gnostic copied to clipboard

go get upgrade broke compilation

Open regnaio opened this issue 2 years ago • 1 comments

Updated packages using go get -u ./...

Then, I tried running a go file using go run <FILE>

Got the error message:

cannot use doc (variable of type *"github.com/google/gnostic/openapiv2".Document) as *"github.com/google/gnostic-models/openapiv2".Document

# k8s.io/client-go/applyconfigurations/meta/v1
/go/pkg/mod/k8s.io/[email protected]/applyconfigurations/meta/v1/unstructured.go:64:38: cannot use doc (variable of type *"github.com/google/gnostic/openapiv2".Document) as *"github.com/google/gnostic-models/openapiv2".Document value in argument to proto.NewOpenAPIData

regnaio avatar Jun 01 '23 07:06 regnaio

Not sure if this will work for you, but I fixed it for myself by going to the client-go project and checking out the tag I was interested in. In your example, that would be v0.27.2. I then opened the go.mod file and found the k8s.io/kube-openapi version. https://github.com/kubernetes/client-go/blob/v0.27.2/go.mod#L30

I updated my go.mod to this version for k8s.io/kube-openapi.

isaaguilar avatar Jun 15 '23 19:06 isaaguilar