Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject only secrets without dots in key #1554

Merged
merged 2 commits into from
May 20, 2021

Conversation

jLopezbarb
Copy link
Contributor

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

Fixes #

Proposed changes

  • When injecting an env file it inject Okteto env vars like the tokens. All these vars have dots in its name.
  • If a secret name has a dot in it it will not be injected into the container

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

codecov bot commented May 20, 2021

Codecov Report

Merging #1554 (006891a) into master (96eed3f) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1554      +/-   ##
==========================================
- Coverage   36.27%   36.26%   -0.02%     
==========================================
  Files          88       88              
  Lines        8407     8410       +3     
==========================================
  Hits         3050     3050              
- Misses       4990     4993       +3     
  Partials      367      367              
Impacted Files Coverage Δ
pkg/okteto/secrets.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 96eed3f...006891a. Read the comment docs.

@@ -101,7 +101,9 @@ func translateServiceEnvFile(ctx context.Context, svc *model.Service, svcName, f
}

for _, e := range envList {
secrets[e.Name] = e.Value
if !strings.Contains(e.Name, ".") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's implement it in okteto.GetSecrets

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

What is the use case that this is solving? And is it common for people to have a dot on their secrets?

@pchico83
Copy link
Contributor

@rberrelleza "." secret in an internal okteto secret, like the github token. "." is not allowed for user defined secrets

@pchico83 pchico83 merged commit 3ae92ed into master May 20, 2021
@pchico83 pchico83 deleted the jlopezbarb/not-inject-secrets-with-dots branch May 20, 2021 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants