From 481308215d8b7ff72cad9572c442615ee6805dc5 Mon Sep 17 00:00:00 2001 From: Matt Moyer Date: Mon, 21 Sep 2020 17:31:07 -0500 Subject: [PATCH] Pass namespace properly in client.ExchangeToken. Signed-off-by: Matt Moyer --- internal/client/client.go | 3 +++ internal/client/client_test.go | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/client/client.go b/internal/client/client.go index 06831cc8..25445a74 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -30,6 +30,9 @@ func ExchangeToken(ctx context.Context, namespace string, idp corev1.TypedLocalO } resp, err := client.LoginV1alpha1().TokenCredentialRequests(namespace).Create(ctx, &v1alpha1.TokenCredentialRequest{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: namespace, + }, Spec: v1alpha1.TokenCredentialRequestSpec{ Token: token, IdentityProvider: idp, diff --git a/internal/client/client_test.go b/internal/client/client_test.go index 482f588a..fd4a564a 100644 --- a/internal/client/client_test.go +++ b/internal/client/client_test.go @@ -100,7 +100,8 @@ func TestExchangeToken(t *testing.T) { "kind": "TokenCredentialRequest", "apiVersion": "login.pinniped.dev/v1alpha1", "metadata": { - "creationTimestamp": null + "creationTimestamp": null, + "namespace": "test-namespace" }, "spec": { "token": "test-token",