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:
parent
3b461572ea
commit
b59a4f3fec
@ -49,11 +49,13 @@ func TestCLIGetKubeconfigStaticToken(t *testing.T) {
|
|||||||
// Build pinniped CLI.
|
// Build pinniped CLI.
|
||||||
pinnipedExe := library.PinnipedCLIPath(t)
|
pinnipedExe := library.PinnipedCLIPath(t)
|
||||||
|
|
||||||
|
credCacheDir := testutil.TempDir(t)
|
||||||
stdout, stderr := runPinnipedCLI(t, nil, pinnipedExe, "get", "kubeconfig",
|
stdout, stderr := runPinnipedCLI(t, nil, pinnipedExe, "get", "kubeconfig",
|
||||||
"--static-token", env.TestUser.Token,
|
"--static-token", env.TestUser.Token,
|
||||||
"--concierge-api-group-suffix", env.APIGroupSuffix,
|
"--concierge-api-group-suffix", env.APIGroupSuffix,
|
||||||
"--concierge-authenticator-type", "webhook",
|
"--concierge-authenticator-type", "webhook",
|
||||||
"--concierge-authenticator-name", authenticator.Name,
|
"--concierge-authenticator-name", authenticator.Name,
|
||||||
|
"--credential-cache", credCacheDir+"/credentials.yaml",
|
||||||
)
|
)
|
||||||
assert.Contains(t, stderr, "discovered CredentialIssuer")
|
assert.Contains(t, stderr, "discovered CredentialIssuer")
|
||||||
assert.Contains(t, stderr, "discovered Concierge endpoint")
|
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",
|
"--scopes", "offline_access,openid,email,profile",
|
||||||
"--listen-port", callbackURL.Port(),
|
"--listen-port", callbackURL.Port(),
|
||||||
"--session-cache", sessionCachePath,
|
"--session-cache", sessionCachePath,
|
||||||
|
"--credential-cache", testutil.TempDir(t)+"/credentials.yaml",
|
||||||
"--skip-browser",
|
"--skip-browser",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user