Skip to content

Commit

Permalink
Fix namespace e2e tests (#1234)
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Chico de Guzman <pchico83@gmail.com>
  • Loading branch information
pchico83 committed Jan 4, 2021
1 parent 4abe2fa commit 9f41d86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/namespace/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func RunNamespace(ctx context.Context, namespace string) error {
}
}

cred, err := okteto.GetCredentials(ctx)
cred, err := okteto.GetCredentials(ctx, namespace)
if err != nil {
return err
}
Expand Down
9 changes: 5 additions & 4 deletions pkg/okteto/credential.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package okteto

import (
"context"
"fmt"
)

// Credentials top body answer
Expand All @@ -31,12 +32,12 @@ type Credential struct {
}

// GetCredentials returns the space config credentials
func GetCredentials(ctx context.Context) (*Credential, error) {
q := `query{
credentials(space: ""){
func GetCredentials(ctx context.Context, namespace string) (*Credential, error) {
q := fmt.Sprintf(`query{
credentials(space: "%s"){
server, certificate, token, namespace
},
}`
}`, namespace)

var cred Credentials
if err := query(ctx, q, &cred); err != nil {
Expand Down

0 comments on commit 9f41d86

Please sign in to comment.