Merge pull request #102181 from enj/enj/i/deprecate_gcp_azure

Deprecate azure and gcp in-tree auth plugins
This commit is contained in:
Kubernetes Prow Robot 2021-07-06 22:10:55 -07:00 committed by GitHub
commit 60475ee5c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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