GithubHelp home page GithubHelp logo

compile error (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) about client-go HOT 7 OPEN

till avatar till commented on June 14, 2024
compile error (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)

from client-go.

Comments (7)

cyclinder avatar cyclinder commented on June 14, 2024 2

I also have an issue like this

# k8s.io/client-go/applyconfigurations/meta/v1
vendor/k8s.io/client-go/applyconfigurations/meta/v1/unstructured.go:64:38: cannot use doc (variable of type *"github.com/google/gnostic-models/openapiv2".Document) as *"github.com/google/gnostic/openapiv2".Document value in argument to proto.NewOpenAPIData
make: *** [build-bin] Error 1
go.mod
	k8s.io/api v0.28.3
	k8s.io/apimachinery v0.28.3
	k8s.io/client-go v0.28.3
	k8s.io/component-base v0.28.3
	k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect

Is there any workarounds?

from client-go.

oshoval avatar oshoval commented on June 14, 2024 1

Hi, I used client-go 0.28.3 with
openapi v0.0.0-20230717233707-2695361300d9
and it fix this problem

but then i have other problem that the swagger which is generated is corrupted
(different issue, and not sure it affects you as well)
For visibility, fields are removed and ref is added instead (our implementation used to dereference them)

      "parameters": [
       {
-       "uniqueItems": true,
-       "type": "string",
-       "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.",
-       "name": "continue",
-       "in": "query"
+       "$ref": "#/parameters/continue-tuthsW5V"
       },

from client-go.

andyzhangx avatar andyzhangx commented on June 14, 2024 1

reverted to k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect works in my env

from client-go.

Inikowu avatar Inikowu commented on June 14, 2024

reverted to k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect works in my env

from client-go.

shashidhar-patil avatar shashidhar-patil commented on June 14, 2024

I am facing the same issue client-go v1.28.1, can anyone help me out ?

from client-go.

neutrinoxxx avatar neutrinoxxx commented on June 14, 2024

Using helm.sh/helm/v3 v3.13.0 and k8s.io/kubectl v0.28.3 should fix this issue.

go.mod

	helm.sh/helm/v3 v3.13.0
	k8s.io/api v0.28.3
	k8s.io/apiextensions-apiserver v0.28.3
	k8s.io/apimachinery v0.28.3
	k8s.io/cli-runtime v0.28.3
	k8s.io/client-go v0.28.3
	sigs.k8s.io/controller-runtime v0.16.5

	k8s.io/kubectl v0.28.3 // indirect

from client-go.

muicoder avatar muicoder commented on June 14, 2024

Upgrading old and new packages can also solve:

# go get github.com/google/gnostic && go get github.com/google/gnostic-models
go: upgraded github.com/google/gnostic v0.6.9 => v0.7.0
go: upgraded github.com/google/gnostic-models v0.6.8 => v0.6.9-0.20230804172637-c7be7c783f49

from client-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.