options/authentication: revert extra serviceaccount TokenGetter function silently enabling serviceaccounts

Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
This commit is contained in:
Dr. Stefan Schimanski
2024-07-21 22:02:52 +02:00
parent 0caeba5cbe
commit dc0bcd62e3
2 changed files with 2 additions and 14 deletions

View File

@@ -494,16 +494,13 @@ func TestWithTokenGetterFunction(t *testing.T) {
called = true
return nil
}
opts := NewBuiltInAuthenticationOptions().WithTokenGetterFunction(f)
opts := NewBuiltInAuthenticationOptions().WithServiceAccounts()
opts.ServiceAccounts.OptionalTokenGetter = f
err := opts.ApplyTo(context.Background(), &genericapiserver.AuthenticationInfo{}, nil, nil, &openapicommon.Config{}, nil, fakeClientset, versionedInformer, "")
if err != nil {
t.Fatal(err)
}
if opts.ServiceAccounts.OptionalTokenGetter == nil {
t.Fatal("expected token getter function to be set")
}
if !called {
t.Fatal("expected token getter function to be called")
}