kubernetes / kube-openapi

Kubernetes OpenAPI spec generation & serving
Apache License 2.0
317 stars 205 forks source link

[Bug] The latest main branch will conflict with k8s client-go@v0.26.5 #434

Closed so2bin closed 11 months ago

so2bin commented 11 months ago

The follow is the error message:

hbb@hbb:~/projs/server$ go mod tidy
hbb@hbb:~/projs/server$ go run atms/main.go  httpserver
# k8s.io/client-go/applyconfigurations/meta/v1
../../../go/pkg/mod/k8s.io/client-go@v0.26.2/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

The go.mod of this error version is:

require(
        istio.io/api v0.0.0-20230302172406-582f573dde0c
    istio.io/client-go v1.17.1
    k8s.io/api v0.26.5
    k8s.io/apimachinery v0.26.5
    k8s.io/client-go v0.26.5
    k8s.io/utils v0.0.0-20230726121419-3b25d923346b
)

require (
        k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
)

The conflict will disappeared with this version:

require(
        istio.io/api v0.0.0-20230302172406-582f573dde0c
    istio.io/client-go v1.17.1
    k8s.io/api v0.26.5
    k8s.io/apimachinery v0.26.5
    k8s.io/client-go v0.26.5
    k8s.io/utils v0.0.0-20230726121419-3b25d923346b
        k8s.io/kube-openapi v0.0.0-20230303024457-afdc3dddf62d // indirect 
)
Jefftree commented 11 months ago

See https://github.com/kubernetes/client-go/issues/1266.

This is expected, please stick to the kube-openapi version in the corresponding go.mod for client-go https://github.com/kubernetes/client-go/blob/v0.26.5/go.mod#L30 or upgrade to a later version of client-go.

/close

k8s-ci-robot commented 11 months ago

@Jefftree: Closing this issue.

In response to [this](https://github.com/kubernetes/kube-openapi/issues/434#issuecomment-1753608116): >See https://github.com/kubernetes/client-go/issues/1266. > >This is expected, please stick to the kube-openapi version in the corresponding go.mod for client-go https://github.com/kubernetes/client-go/blob/v0.26.5/go.mod#L30 or upgrade to a later version of client-go. > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.