From 71d7e29954a08c5a582f9b9d7fd4c5cbeb1fb4a2 Mon Sep 17 00:00:00 2001 From: Anish Ramasekar Date: Wed, 24 Jul 2024 14:35:21 -0700 Subject: [PATCH] cleanup unused fn IsValidServiceAccountKeyFile in authenticator config Signed-off-by: Anish Ramasekar --- pkg/kubeapiserver/authenticator/config.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pkg/kubeapiserver/authenticator/config.go b/pkg/kubeapiserver/authenticator/config.go index 780d4f4e7be..9b1655b139a 100644 --- a/pkg/kubeapiserver/authenticator/config.go +++ b/pkg/kubeapiserver/authenticator/config.go @@ -49,7 +49,6 @@ import ( // Initialize all known client auth plugins. _ "k8s.io/client-go/plugin/pkg/client/auth" - "k8s.io/client-go/util/keyutil" "k8s.io/kubernetes/pkg/serviceaccount" ) @@ -325,12 +324,6 @@ func (c *authenticationConfigUpdater) updateAuthenticationConfig(ctx context.Con return nil } -// IsValidServiceAccountKeyFile returns true if a valid public RSA key can be read from the given file -func IsValidServiceAccountKeyFile(file string) bool { - _, err := keyutil.PublicKeysFromFile(file) - return err == nil -} - // newAuthenticatorFromTokenFile returns an authenticator.Token or an error func newAuthenticatorFromTokenFile(tokenAuthFile string) (authenticator.Token, error) { tokenAuthenticator, err := tokenfile.NewCSV(tokenAuthFile)