Coder Social home page Coder Social logo

Kubernetes 1.26/1.27 support about pkg HOT 7 CLOSED

wlynch avatar wlynch commented on August 21, 2024 1
Kubernetes 1.26/1.27 support

from pkg.

Comments (7)

dprotaso avatar dprotaso commented on August 21, 2024

Hey - we're still targeting v1.24 as per our release schedule. We'll be moving to v1.25 in the next few weeks.

Cannot build because the injection interface is missing the new

So these dynamic wrapped clients were introduced here - #2210 But they're a bit of a headache as you encountered because the codegen/interface need to be updated.

Since Knative isn't actually using this functionality I'm thinking we just purge this from knative.dev/pkg and downstream repos can just generate these clients themselves.

cc @pierDipi
cc @imjasonh since I think this was added because of tekton chains

from pkg.

wlynch avatar wlynch commented on August 21, 2024

Hey - we're still targeting v1.24 as per our release schedule. We'll be moving to v1.25 in the next few weeks.

Anything that relies on knative.dev/pkg and has a transitive dependency using k8s 1.26+ will break because we aren't including the new k8s client interfaces (regardless if they're being used). Because of Go's minimum version selection this is getting harder to avoid as more dependencies update. 😢

Not looking to bump the minimum supported server version - I'm looking to add support for the new k8s client interface definition so the injection client can be forwards compatible.

So these dynamic wrapped clients were introduced here - #2210 But they're a bit of a headache as you encountered because the codegen/interface need to be updated.

I'm thinking since Knative isn't actually using this functionality I'm thinking we just purge this from knative.dev/pkg and downstream repos can just generate these clients themselves.

This is for the typed k8s client, which looks like has usage across knative. I don't think the dynamic client is affected by this.

from pkg.

wlynch avatar wlynch commented on August 21, 2024

I see what you're saying now about the dynamic client - it's because that's what the wrapClient is used for.

An idea - what if we modify the codegen to do this:

type wrapClient struct {
+	kubernetes.Interface
	dyn dynamic.Interface
}

- var _ kubernetes.Interface = (*wrapClient)(nil)

This would let the client satisfy newer interface versions, even if Go mod used a newer client version. This has a downside of if you tried to access a newer client API then what knative supports it will panic, but we're already allowing panics for Discovery endpoints and as long as you're using existing API versions you shouldn't see a difference.

wdyt? 🤔

from pkg.

pierDipi avatar pierDipi commented on August 21, 2024

The additional methods called _expansions are also panic-ing with NYI (not yet implemented): https://github.com/knative/pkg/blob/main/client/injection/kube/client/client_expansion.go, so the panic issue is currently already present for new methods that we don't use

from pkg.

pierDipi avatar pierDipi commented on August 21, 2024

The downside is that instead of having a NYI panic, we will get a nil panic? which would make the error message a lot more cryptic?

from pkg.

wlynch avatar wlynch commented on August 21, 2024

Played around with this a bit - the codegen wasn't working for me because the repo wasn't on GOPATH.

The interface embedding isn't going to work because it will still fail for interfaces that were removed in newer k8s client versions (I ran into issues with the deprecated PodSecurityPolicy interface since it was removed in newer versions).

from pkg.

dprotaso avatar dprotaso commented on August 21, 2024

@wlynch we removed the dynamic.Client backed kubernetes.Interface wrapper that was causing problems.

PR #2742

You should be able to go get knative.dev/pkg@latest and then bump your k8s libs to the version you want.

from pkg.

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.