vks-k8s-auth v1.0.0
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 authentication —
NewVksGuestClusterAuthClientbuilds 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 clusters —
GenerateKubeconfig()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 access —
GetToken()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 reset —
ResetHTTPClient()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 orTimeout).
Breaking changes
NewVksK8sAuthClienthas been renamed toNewVksSupervisorAuthClientfor naming consistency with the newNewVksGuestClusterAuthClient. Update existing call sites accordingly.Login()now returns aSupervisorLoginResponseinstead of the raw response bytes.NewVksGuestClusterAuthClientnow requires bothVksAuthConfig.GuestClusterNameandVksAuthConfig.GuestClusterNamespaceto 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/NewVksGuestClusterAuthClientreturn an error instead of silently falling back to the system trust store.
Config additions
VksAuthConfig.GuestClusterNameandVksAuthConfig.GuestClusterNamespaceidentify the target guest cluster when usingNewVksGuestClusterAuthClient.VksAuthConfig.Timeoutconfigures the login request timeout in seconds (defaults to 20).