cleanup unused fn IsValidServiceAccountKeyFile in authenticator config

Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
This commit is contained in:
Anish Ramasekar 2024-07-24 14:35:21 -07:00
parent df69a528d5
commit 71d7e29954
No known key found for this signature in database
GPG Key ID: E96F745A34A409C2

View File

@ -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)