mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-28 19:53:00 +00:00
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> Kubernetes-commit: 6bfaeaf91658835aeea267500299de1c4a35a248
This commit is contained in:
parent
68cb2ddef9
commit
e2b531141a
@ -84,7 +84,16 @@ func (c *azureTokenCache) setToken(tokenKey string, token *azureToken) {
|
|||||||
c.cache[tokenKey] = token
|
c.cache[tokenKey] = token
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var warnOnce sync.Once
|
||||||
|
|
||||||
func newAzureAuthProvider(_ string, cfg map[string]string, persister restclient.AuthProviderConfigPersister) (restclient.AuthProvider, error) {
|
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 (
|
var (
|
||||||
ts tokenSource
|
ts tokenSource
|
||||||
environment azure.Environment
|
environment azure.Environment
|
||||||
|
@ -113,7 +113,16 @@ type gcpAuthProvider struct {
|
|||||||
persister restclient.AuthProviderConfigPersister
|
persister restclient.AuthProviderConfigPersister
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var warnOnce sync.Once
|
||||||
|
|
||||||
func newGCPAuthProvider(_ string, gcpConfig map[string]string, persister restclient.AuthProviderConfigPersister) (restclient.AuthProvider, error) {
|
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)
|
ts, err := tokenSource(isCmdTokenSource(gcpConfig), gcpConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user