Deprecate azure and gcp in-tree auth plugins

With the client-go credential plugin functionality going GA in 1.22,
it is now time to deprecate these legacy integrations.

Signed-off-by: Monis Khan <mok@vmware.com>
This commit is contained in:
Monis Khan 2021-05-20 11:54:16 -04:00
parent 7cd40e1885
commit 6bfaeaf916
No known key found for this signature in database
GPG Key ID: 52C90ADA01B269B8
2 changed files with 18 additions and 0 deletions

View File

@ -84,7 +84,16 @@ func (c *azureTokenCache) setToken(tokenKey string, token *azureToken) {
c.cache[tokenKey] = token
}
var warnOnce sync.Once
func newAzureAuthProvider(_ string, cfg map[string]string, persister restclient.AuthProviderConfigPersister) (restclient.AuthProvider, error) {
// deprecated in v1.22, remove in v1.25
// this should be updated to use klog.Warningf in v1.24 to more actively warn consumers
warnOnce.Do(func() {
klog.V(1).Infof(`WARNING: the azure auth plugin is deprecated in v1.22+, unavailable in v1.25+; use https://github.com/Azure/kubelogin instead.
To learn more, consult https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins`)
})
var (
ts tokenSource
environment azure.Environment

View File

@ -113,7 +113,16 @@ type gcpAuthProvider struct {
persister restclient.AuthProviderConfigPersister
}
var warnOnce sync.Once
func newGCPAuthProvider(_ string, gcpConfig map[string]string, persister restclient.AuthProviderConfigPersister) (restclient.AuthProvider, error) {
// deprecated in v1.22, remove in v1.25
// this should be updated to use klog.Warningf in v1.24 to more actively warn consumers
warnOnce.Do(func() {
klog.V(1).Infof(`WARNING: the gcp auth plugin is deprecated in v1.22+, unavailable in v1.25+; use gcloud instead.
To learn more, consult https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins`)
})
ts, err := tokenSource(isCmdTokenSource(gcpConfig), gcpConfig)
if err != nil {
return nil, err