Update TestCLIGetKubeconfig to ignore stderr output from get-kubeconfig.

This will now have a deprecation warning, so we can't treat is as part of the YAML output.

Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
Matt Moyer 2020-12-14 13:25:03 -06:00
parent f9691208d5
commit fe4e2d620d
No known key found for this signature in database
GPG Key ID: EAE88AD172C5AE2D

View File

@ -102,9 +102,14 @@ func runPinnipedCLIGetKubeconfig(t *testing.T, pinnipedExe, token, namespaceName
"--pinniped-namespace", namespaceName, "--pinniped-namespace", namespaceName,
"--authenticator-type", authenticatorType, "--authenticator-type", authenticatorType,
"--authenticator-name", authenticatorName, "--authenticator-name", authenticatorName,
).CombinedOutput() ).Output()
require.NoError(t, err, string(output))
// Log stderr if there is a problem.
var exitErr *exec.ExitError
if errors.As(err, &exitErr) {
t.Logf("stderr:\n%s\n", string(exitErr.Stderr))
}
require.NoError(t, err, string(output))
return string(output) return string(output)
} }