GithubHelp home page GithubHelp logo

Comments (8)

pkwarren avatar pkwarren commented on June 3, 2024 2

Would you be open to a PR which updates the generated proto code to come from gnostic-models and provides type aliases for compatibility with existing code, i.e. replace discovery/discovery.pb.go with:

package discovery_v1

import (
	models "github.com/google/gnostic-models/discovery"
)

type Annotations = models.Annotations
type Any = models.Any
type Auth = models.Auth
...
type Simple = models.Simple
type StringArray = models.StringArray

var File_discovery_discovery_proto = models.File_discovery_discovery_proto

This should allow for a Go module to depend on code both from gnostic and gnostic-models without panicing.

from gnostic.

Jefftree avatar Jefftree commented on June 3, 2024 1

Summary of the issue:
gnostic was renamed to gnostic-models in kubernetes which affects mainly importers of client-go and kube-openapi. Some of the workarounds have been described in kubernetes/client-go#1269 (comment) and kubernetes/client-go#1269 (comment).

These issues should be fully resolved once kubernetes 1.28 is released and a workaround is not needed to use an alpha client. In the meantime, #400 is a generalized way of solving this for projects that do not have any kubernetes dependencies.

from gnostic.

pkwarren avatar pkwarren commented on June 3, 2024

For example, k8s.io/kube-openapi recently updated to switch to gnostic-models in kubernetes/kube-openapi#402. The latest release of https://github.com/kubernetes/apimachinery/releases/tag/v0.27.2 and https://github.com/kubernetes/apiserver/releases/tag/v0.27.2 are still using gnostic (although unreleased versions look like they're switching to use gnostic-models).

from gnostic.

Jefftree avatar Jefftree commented on June 3, 2024

This is a known issue. The latest releases of apimachinery v0.27.2 uses a corresponding version of kube-openapi that also uses gnostic instead of gnostic-models: https://github.com/kubernetes/apimachinery/blob/v0.27.2/go.mod#L26. Please stick to the pinned dependency versions to prevent drift in the modules.

from gnostic.

pkwarren avatar pkwarren commented on June 3, 2024

Ok - we hit this with an upgrade to kube-openapi (which has no tags so it picked up the latest commit). Hopefully over the next few releases of libraries things will stabilize to only depend on gnostic-models instead of a combination of gnostic-models and gnostic.

from gnostic.

pkwarren avatar pkwarren commented on June 3, 2024

Related: kubernetes/kube-openapi#404

from gnostic.

Jefftree avatar Jefftree commented on June 3, 2024

Sounds like a great idea, do you want to go ahead with the PR? cc @timburks

from gnostic.

pkwarren avatar pkwarren commented on June 3, 2024

Sounds like a great idea, do you want to go ahead with the PR? cc @timburks

Opened #400 with a proposed change.

from gnostic.

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.