Skip to content

Commit

Permalink
Inject only secrets without dots in key (#1554)
Browse files Browse the repository at this point in the history
* Inject only secrets without dots in key

Signed-off-by: Javier López Barba <javier@okteto.com>

* Move secrets filtering to GetSecrets

Signed-off-by: Javier López Barba <javier@okteto.com>
  • Loading branch information
jLopezbarb committed May 20, 2021
1 parent c13640e commit 3ae92ed
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/okteto/secrets.go
Expand Up @@ -15,6 +15,7 @@ package okteto

import (
"context"
"strings"
)

//Secrets represents a list of secrets
Expand All @@ -40,6 +41,11 @@ func GetSecrets(ctx context.Context) ([]Secret, error) {
if err := query(ctx, q, &body); err != nil {
return nil, err
}

return body.Secrets, nil
secrets := make([]Secret, 0)
for _, secret := range body.Secrets {
if !strings.Contains(secret.Name, ".") {
secrets = append(secrets, secret)
}
}
return secrets, nil
}

0 comments on commit 3ae92ed

Please sign in to comment.