Skip to content

Support specifying --set multiple times #1751

Closed

Description

@james-w

Hello,

Today (v2.1.0) if you specify --set a second time to install it is ignored.
That is surprising and possibly would lead to a bad situation like a
default admin password instead of the one the user thought they were
setting.

However, I think the solution is to support multiple --set options,
as it is nicer for scripting, and possibly interactive use as well.

  • It allows for multiple options to be built up more easily in a script (no checking if it's the first option to avoid prepending a comma).
  • It avoids long lines
  • It scans better to see where each option is and what the value is

I realise that there is a yaml file for specifying values in an even nicer way,
but if you are writing a bash script that generates some of the values
(the image tag, random passwords for a test), you don't want to try
and serialize valid yaml, it's easier to build a command line.

It would even pave the way to allow commas in values with some other
option to turn on that backwards-incompatible behaviour.

Thanks,

James

Activity

  1. syhol commented on Dec 23, 2016

    @syhol

    You can comma seperate the values

    --set foo=bar,qux=baz

    foo: {{ .Values.foo }}
    qux: {{ .Values.qux }}

    Would build

    foo: bar
    qux: baz

    it's also in the help text:

    $ helm install --help
    ...
    --set string      set values on the command line. Separate values with commas: key1=val1,key2=val2
    ...
    
  2. james-w commented on Dec 23, 2016

    @james-w
    Author

    Yep, I'm aware, thanks. However I don't think that comma-separated is ideal, and would like the option of using --set multiple times, or at the very least getting an error if I try.

  3. syhol commented on Dec 23, 2016

    @syhol

    Ah I see. My first attempt at setting multiple values via the --set command was --set k1=v1 --set k2=v2 as it is the way I've interacted with CLI's in the past. I had to look it up in the docs to learn how to do it the helm way, so I understand why you would want this, and like you say this would allow commas in values.

    In that case, I think the helm team could:

    • Allow multiple --set in the next minor (2.x)
    • Deprecate the comma separation method in the next minor (2.x)
    • Remove the comma separation method in the next major (3.0)
  4. technosophos commented on Dec 23, 2016

    @technosophos
    Member

    I believe we now support multiple -f flags, so it does make sense to support multiple --set flags. I'm going to mark this as a "starter" because it's really just a matter of modifying cmd/helm/install.go and cmd/helm/upgrade.go to change the flag behavior.

    Update: However, we probably won't deprecate the comma-separated version for a while yet. We could definitely discuss removing that feature in Helm 3.x.

  5. added this to the milestone on Dec 23, 2016
  6. modified the milestones: 2.2.0, on Jan 13, 2017
  7. james-w commented on Jan 13, 2017

    @james-w
    Author

    Great, thanks!

  8. mcandre commented on Mar 8, 2017

    @mcandre

    The current design causes #1556

  9. dsample commented on Jan 24, 2018

    @dsample

    About the comma-separated key value pairs, having the option to turn comma-separation off would be nice, as we need to specify strings with multiple commas in them (eg. mongo connection strings), and escaping these from within shell scripts/CD tooling/environment variables can be a pain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions