generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly handle different versioned resources in gwctl (eg. v1beta1 v…
…/s v1 APIs) and related code cleanups (#3001) * Propagate label selection filter when describing backends * Allow fetching individual resources through get command * fix: Display error when failing to construct resourceModel in tests * Adjust tests to work with NewSimpleDynamicClientWithCustomListKinds(). The dynamic client returned for unit tests may not be smart enough to automatically guess the APIVersion and Kind (which the real kube-apiserver can handle automatically). To get over this, we can simply simply include these when creating the objects. * Use API discovery to determine the preferred API versions for Gateway API types. Clusters may not always have the v1 CRDs installed. This means gwctl will have to use whatever version is available in the cluster. Hence, we will use API Discovery to determine the "preferred" API version as per the kube-apiserver and then use a dynamic client to fetch that specific versioned resource. Once that specific versioned resource is fetched (e.g. v1beta1.Gateway), it will be converted to a concrete type used within gwctl (eg. v1.Gateway), which will usually be a more newer/stable version. For most cases, this conversion should not result in any losses. If in the future, a need arises for such special cases, we should be able to extend the approach by configuring some conversion functions (eg. conversion function for v1beta1.Gateway -> v1.Gateway). * fixup! Use API discovery to determine the preferred API versions for Gateway API types.
- Loading branch information
1 parent
6ba965a
commit ab850c3
Showing
11 changed files
with
267 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.