Coder Social home page Coder Social logo

Comments (9)

manics avatar manics commented on July 2, 2024 2

In case it's useful here's my temporary workaround manics@9f8e581

from helmfile.

mumoshu avatar mumoshu commented on July 2, 2024 1

@cmeury Thanks for the thoughtful response as always!

potential frustration by having to conform to a "foreign" naming scheme
unexpected behavior such as accidentally naming the variable as a "secret" and then wondering why it's not printed for hours.

Good points. I can't agree more!

Then, I'd be happy with something like {{ secretenv "MY_TOKEN" }}, without a hyphen, which conforms naming convention seen in golang text/template funcs in the wild.

from helmfile.

cmeury avatar cmeury commented on July 2, 2024

Or we define a function called env_secret that will not output the contents?

from helmfile.

mumoshu avatar mumoshu commented on July 2, 2024

@cmeury Good point! But I can't exactly say which is the best one here - both seems nice in its own way.

Anyone has a preference, and why is that? 🤔

from helmfile.

cmeury avatar cmeury commented on July 2, 2024

I dislike introducing a variable naming convention for this, because it's quite restrictive for the user (potential frustration by having to conform to a "foreign" naming scheme) and it could lead to unexpected behavior such as accidentally naming the variable as a "secret" and then wondering why it's not printed for hours.

from helmfile.

manics avatar manics commented on July 2, 2024

I just ran into a related issue which might be covered by this whilst setting up a deployment with GitLab. I'm working on an opensource project so I'd like the deploy logs which include helm sync to be open but this means masking some secret env-vars which are passed from GitLab. The quiet -q in helm -q sync is too quiet since it also hides the output of helm.

Might another way around this be a flag that suppresses this line, or prints out a shortened version without all the args?

helm.write([]byte(fmt.Sprintf("exec: helm %s\n", strings.Join(cmdargs, " "))))

from helmfile.

mumoshu avatar mumoshu commented on July 2, 2024

@manics Thanks for sharing your work!

I'd rather like helmfile to be declarative as much as possible so I'm inclined to the secretenv approach noted above, for the purpose of resolving this issue.

However, your work could be useful for operational purpose, like in cases that you want to logger the logging level for fewer outputs from a helmfile run.

So, would it make sense to discuss in another issue about logging level(trace, debug, info, warn, and so on) and probably suppress exec: helm $args outputs in the info/warn levels but not in trace/debug?

from helmfile.

mumoshu avatar mumoshu commented on July 2, 2024

@manics Hi! Thanks for the suggestion and creating the issue #93.

I'm now inclined to the feature you call a workaround. It turns out to me that, masking only {{secretenv "..." }} of templated strings adds little value compared to the amount of code required for implementation.

Would you mind submitting your work as a PR? Code LGTM and I'll be merging it quickly 😆

from helmfile.

mumoshu avatar mumoshu commented on July 2, 2024

I believe this isn't needed anymore because we now have configurable log level thanks to #93 #185.
As long the log level is greater than debug, executed helm command and therefore those secrets are not logged.

Also note that we basically should not log secrets #202 #206

from helmfile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.