Pass namespace properly in client.ExchangeToken.

Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
Matt Moyer 2020-09-21 17:31:07 -05:00
parent 381fd51e13
commit 481308215d
No known key found for this signature in database
GPG Key ID: EAE88AD172C5AE2D
2 changed files with 5 additions and 1 deletions

View File

@ -30,6 +30,9 @@ func ExchangeToken(ctx context.Context, namespace string, idp corev1.TypedLocalO
} }
resp, err := client.LoginV1alpha1().TokenCredentialRequests(namespace).Create(ctx, &v1alpha1.TokenCredentialRequest{ resp, err := client.LoginV1alpha1().TokenCredentialRequests(namespace).Create(ctx, &v1alpha1.TokenCredentialRequest{
ObjectMeta: metav1.ObjectMeta{
Namespace: namespace,
},
Spec: v1alpha1.TokenCredentialRequestSpec{ Spec: v1alpha1.TokenCredentialRequestSpec{
Token: token, Token: token,
IdentityProvider: idp, IdentityProvider: idp,

View File

@ -100,7 +100,8 @@ func TestExchangeToken(t *testing.T) {
"kind": "TokenCredentialRequest", "kind": "TokenCredentialRequest",
"apiVersion": "login.pinniped.dev/v1alpha1", "apiVersion": "login.pinniped.dev/v1alpha1",
"metadata": { "metadata": {
"creationTimestamp": null "creationTimestamp": null,
"namespace": "test-namespace"
}, },
"spec": { "spec": {
"token": "test-token", "token": "test-token",