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

client-go 0.23.5 run blocked #1084

Closed
regnaio opened this issue Apr 13, 2022 · 9 comments
Closed

client-go 0.23.5 run blocked #1084

regnaio opened this issue Apr 13, 2022 · 9 comments

Comments

@regnaio
Copy link

regnaio commented Apr 13, 2022

Using go 1.18.1 or go 1.17.9 and client-go 0.23.5

go run <script using client-go>

# k8s.io/client-go/applyconfigurations/meta/v1
/go/pkg/mod/k8s.io/client-go@v0.23.5/applyconfigurations/meta/v1/unstructured.go:64:38: cannot use doc (variable of type *"github.com/googleapis/gnostic/openapiv2".Document) as type *"github.com/google/gnostic/openapiv2".Document in argument to proto.NewOpenAPIData
@regnaio regnaio changed the title go 1.18.1 and client-go 0.23.5 run blocked client-go 0.23.5 run blocked Apr 13, 2022
@simongottschlag
Copy link

It helped reverting client-go to v0.22.8 for me. Just a work around though.

simongottschlag added a commit to XenitAB/azad-kube-proxy that referenced this issue Apr 14, 2022
@liggitt
Copy link
Member

liggitt commented Apr 14, 2022

make sure you have matching client-go and other k8s.io/... module versions

@liggitt
Copy link
Member

liggitt commented Apr 14, 2022

(and are using the version of k8s.io/kube-openapi indicated by your version of client-go)

@liggitt
Copy link
Member

liggitt commented Apr 14, 2022

I suspect you are trying to use HEAD of k8s.io/kube-openapi with v0.23.5 of client-go

@liggitt
Copy link
Member

liggitt commented Apr 14, 2022

client-go 0.23.5 uses this version of kube-openapi:

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

https://github.com/kubernetes/kube-openapi/commits/master/pkg/util/proto shows the history of that file, which changed the signature of that method from googleapis/gnostic → google/gnostic on 3/10/2022

the error you're getting indicates you were using a version of kube-openapi >= 3/10/2022 in your build

@liggitt liggitt closed this as completed Apr 14, 2022
kieron-dev pushed a commit to cloudfoundry/eirini-controller that referenced this issue Apr 25, 2022
If not, `go get -u` bumps it giving incompatible imports of
- github.com/google/gnostic, and
- github.com/googleapis/gnostic

See kubernetes/client-go#1084
@Laarryliu
Copy link

client-go 0.23.5 uses this version of kube-openapi:

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

https://github.com/kubernetes/kube-openapi/commits/master/pkg/util/proto shows the history of that file, which changed the signature of that method from googleapis/gnostic → google/gnostic on 3/10/2022

the error you're getting indicates you were using a version of kube-openapi >= 3/10/2022 in your build

just add replace k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 and it works, thanks a lot!

@walteh
Copy link

walteh commented Jun 9, 2023

The problem came up again this week from this pr in kube-openapi.

I solved it today by updating client-go to include this commit.

Warning this is not a long term fix and should only be used if necessary and until v0.28.0 is stable.

// go.mod
replace k8s.io/client-go => k8s.io/client-go v0.28.0-alpha.2

@lowang-bh
Copy link
Member

also met this error with client-go v0.27.0~v0.27.2

@bxy4543
Copy link

bxy4543 commented Sep 28, 2023

# k8s.io/client-go/openapi
../../../../../../pkg/mod/k8s.io/client-go@v0.25.6/openapi/groupversion.go:35:18: undefined: handler3.OpenAPIV3DiscoveryGroupVersion
../../../../../../pkg/mod/k8s.io/client-go@v0.25.6/openapi/groupversion.go:38:52: undefined: handler3.OpenAPIV3DiscoveryGroupVersion
../../../../../../pkg/mod/k8s.io/client-go@v0.25.6/openapi/client.go:52:24: undefined: handler3.OpenAPIV3Discovery

https://pkg.go.dev/k8s.io/kube-openapi/pkg/handler3?tab=versions

replace k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20220803164354-a70c9af30aea

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

7 participants