Skip to content

vks-k8s-auth v1.0.0

Choose a tag to compare

@tribock tribock released this 21 Jul 07:43

v1.0.0

First breaking release.
Adds Tanzu guest cluster authentication support alongside the existing Supervisor client, and renames the client constructors for clarity.

New features

  • Guest cluster authenticationNewVksGuestClusterAuthClient builds a Kubernetes client scoped to a Tanzu guest cluster, authenticating through the Supervisor and using the cluster's control-plane endpoint/CA.
  • Kubeconfig generation for guest clustersGenerateKubeconfig() now also works against the guest cluster client, and a new example (examples/k8s-guest-cluster-client) demonstrates listing namespaces and generating a kubeconfig for a guest cluster.
  • Token accessGetToken() exposes the current JWT for callers that need the raw token.
  • Thread-safe token access — token reads/writes (GetToken(), TokenValid(), TokenExpiry(), GenerateKubeconfig(), Login(), RefreshToken()) are now synchronized, making it safe to call these concurrently on the same client instance.
  • HTTP client resetResetHTTPClient() closes idle connections and discards the cached HTTP client, forcing a fresh client/connection to be built on the next login call (e.g. after changing TLS settings or Timeout).

Breaking changes

  • NewVksK8sAuthClient has been renamed to NewVksSupervisorAuthClient for naming consistency with the new NewVksGuestClusterAuthClient. Update existing call sites accordingly.
  • Login() now returns a SupervisorLoginResponse instead of the raw response bytes.
  • NewVksGuestClusterAuthClient now requires both VksAuthConfig.GuestClusterName and VksAuthConfig.GuestClusterNamespace to be set, failing fast with an error if either is missing.

Behavior changes

  • Client construction now fails closed: if the Supervisor/guest cluster's CA certificate cannot be captured during setup, NewVksSupervisorAuthClient/NewVksGuestClusterAuthClient return an error instead of silently falling back to the system trust store.

Config additions

  • VksAuthConfig.GuestClusterName and VksAuthConfig.GuestClusterNamespace identify the target guest cluster when using NewVksGuestClusterAuthClient.
  • VksAuthConfig.Timeout configures the login request timeout in seconds (defaults to 20).