mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-01-07 14:05:50 +00:00
Use a temporary directory for credential cache in CLI tests.
This avoids polluting the main cache directory on developer machines. Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
@@ -49,11 +49,13 @@ func TestCLIGetKubeconfigStaticToken(t *testing.T) {
|
||||
// Build pinniped CLI.
|
||||
pinnipedExe := library.PinnipedCLIPath(t)
|
||||
|
||||
credCacheDir := testutil.TempDir(t)
|
||||
stdout, stderr := runPinnipedCLI(t, nil, pinnipedExe, "get", "kubeconfig",
|
||||
"--static-token", env.TestUser.Token,
|
||||
"--concierge-api-group-suffix", env.APIGroupSuffix,
|
||||
"--concierge-authenticator-type", "webhook",
|
||||
"--concierge-authenticator-name", authenticator.Name,
|
||||
"--credential-cache", credCacheDir+"/credentials.yaml",
|
||||
)
|
||||
assert.Contains(t, stderr, "discovered CredentialIssuer")
|
||||
assert.Contains(t, stderr, "discovered Concierge endpoint")
|
||||
@@ -383,6 +385,7 @@ func oidcLoginCommand(ctx context.Context, t *testing.T, pinnipedExe string, ses
|
||||
"--scopes", "offline_access,openid,email,profile",
|
||||
"--listen-port", callbackURL.Port(),
|
||||
"--session-cache", sessionCachePath,
|
||||
"--credential-cache", testutil.TempDir(t)+"/credentials.yaml",
|
||||
"--skip-browser",
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user