Pass namespace properly in client.ExchangeToken.
Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
parent
381fd51e13
commit
481308215d
@ -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,
|
||||||
|
@ -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",
|
||||||
|
Loading…
Reference in New Issue
Block a user