diff --git a/go.mod b/go.mod index 46687851..e6a83143 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba google.golang.org/protobuf v1.26.0 - k8s.io/api v0.0.0-20210705094346-9f69feafab6a + k8s.io/api v0.0.0-20210707054401-2c49f10e0b15 k8s.io/apimachinery v0.0.0-20210701054147-830375057167 k8s.io/klog/v2 v2.9.0 k8s.io/utils v0.0.0-20210521133846-da695404a2bc @@ -39,6 +39,6 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20210705094346-9f69feafab6a + k8s.io/api => k8s.io/api v0.0.0-20210707054401-2c49f10e0b15 k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20210701054147-830375057167 ) diff --git a/go.sum b/go.sum index 08b0dc30..4539c043 100644 --- a/go.sum +++ b/go.sum @@ -444,8 +444,8 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.0.0-20210705094346-9f69feafab6a h1:IF+SZibisSFDDUi+Gll4HgpnMjzP2lp6YlymxNtbtdw= -k8s.io/api v0.0.0-20210705094346-9f69feafab6a/go.mod h1:zoURDvOPW5UMFZr2YUU/sStjYnWSPt+x+MM4R94ATgQ= +k8s.io/api v0.0.0-20210707054401-2c49f10e0b15 h1:KDL/0Eab3o5BswoTN53Hp0H1QFN8RGD/x2ItzJN9l4g= +k8s.io/api v0.0.0-20210707054401-2c49f10e0b15/go.mod h1:zoURDvOPW5UMFZr2YUU/sStjYnWSPt+x+MM4R94ATgQ= k8s.io/apimachinery v0.0.0-20210701054147-830375057167 h1:fob/j8+uMBIVvyo+9bG7GvjFSj0LX3RNuSXW+RcUrwo= k8s.io/apimachinery v0.0.0-20210701054147-830375057167/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= diff --git a/plugin/pkg/client/auth/azure/azure.go b/plugin/pkg/client/auth/azure/azure.go index f4eeb858..ad60243d 100644 --- a/plugin/pkg/client/auth/azure/azure.go +++ b/plugin/pkg/client/auth/azure/azure.go @@ -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 diff --git a/plugin/pkg/client/auth/gcp/gcp.go b/plugin/pkg/client/auth/gcp/gcp.go index ee1bfdef..7ec872e8 100644 --- a/plugin/pkg/client/auth/gcp/gcp.go +++ b/plugin/pkg/client/auth/gcp/gcp.go @@ -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