Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle different versioned resources in gwctl (eg. v1beta1 v/s v1 APIs) and related code cleanups #3001

Merged
merged 6 commits into from
May 2, 2024

Commits on May 1, 2024

  1. Configuration menu
    Copy the full SHA
    d7f802f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7f9d361 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4b74e96 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2024

  1. 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.
    gauravkghildiyal committed May 2, 2024
    Configuration menu
    Copy the full SHA
    2b0628d View commit details
    Browse the repository at this point in the history
  2. 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).
    gauravkghildiyal committed May 2, 2024
    Configuration menu
    Copy the full SHA
    9d9aa93 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    97fd55a View commit details
    Browse the repository at this point in the history