From 6980728f27f448008f5e1fb8d5d72c599f90756c Mon Sep 17 00:00:00 2001 From: Arthur Befumo <34725560+Arthur-Befumo@users.noreply.github.com> Date: Wed, 2 Jul 2025 11:55:24 -0400 Subject: [PATCH] Fix AuthInfo godoc for Token / TokenFile precedence (#132659) * Fix AuthInfo godoc for Token / TokenFile precedence * nit * update Kubernetes-commit: 33cd2e1ba08bf6b936c0c2c29bcabe502ce75851 --- tools/clientcmd/api/types.go | 3 ++- tools/clientcmd/api/v1/types.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/clientcmd/api/types.go b/tools/clientcmd/api/types.go index 95b0b16d..8c64adb8 100644 --- a/tools/clientcmd/api/types.go +++ b/tools/clientcmd/api/types.go @@ -125,7 +125,8 @@ type AuthInfo struct { // Token is the bearer token for authentication to the kubernetes cluster. // +optional Token string `json:"token,omitempty" datapolicy:"token"` - // TokenFile is a pointer to a file that contains a bearer token (as described above). If both Token and TokenFile are present, Token takes precedence. + // TokenFile is a pointer to a file that contains a bearer token (as described above). If both Token and TokenFile are present, + // the TokenFile will be periodically read and the last successfully read value takes precedence over Token. // +optional TokenFile string `json:"tokenFile,omitempty"` // Impersonate is the username to act-as. diff --git a/tools/clientcmd/api/v1/types.go b/tools/clientcmd/api/v1/types.go index f144e16e..c278817b 100644 --- a/tools/clientcmd/api/v1/types.go +++ b/tools/clientcmd/api/v1/types.go @@ -115,7 +115,8 @@ type AuthInfo struct { // Token is the bearer token for authentication to the kubernetes cluster. // +optional Token string `json:"token,omitempty" datapolicy:"token"` - // TokenFile is a pointer to a file that contains a bearer token (as described above). If both Token and TokenFile are present, Token takes precedence. + // TokenFile is a pointer to a file that contains a bearer token (as described above). If both Token and TokenFile are present, + // the TokenFile will be periodically read and the last successfully read value takes precedence over Token. // +optional TokenFile string `json:"tokenFile,omitempty"` // Impersonate is the username to impersonate. The name matches the flag.