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

--set and maps #2547

Closed
vromero opened this issue Jun 6, 2017 · 8 comments
Closed

--set and maps #2547

vromero opened this issue Jun 6, 2017 · 8 comments
Assignees
Labels

Comments

@vromero
Copy link

vromero commented Jun 6, 2017

I have a configuration in values.yaml as follows:

someone:
  - name : "mister"
    surname : "pompapdur"

To try to override I tried the following:

helm install my-chart --set "someone={{name=john, surname=doe}}"

But I get:

Error: failed parsing --set data: key "}" has no value

Is there a way to pass a map from the command line?

@technosophos
Copy link
Member

It's not the map that is difficult to deal with, it's the list. Until recently, there was no way to access items in a list from --set. But we are about to merge a fix for this into Helm 2.5

In Helm 2.5, you will do it like this:

helm --set someone[0].name=mister,someone[0].surname=pompadur

@technosophos
Copy link
Member

See #2545

@technosophos technosophos self-assigned this Jun 7, 2017
@technosophos technosophos added this to the 2.5.0 - Features milestone Jun 7, 2017
@technosophos
Copy link
Member

Closed by #2545

@4c74356b41
Copy link

i like how the person doesnt answer the original question but talks about passing lists through command line. entertaining.

@bacongobbler
Copy link
Member

The original question asked about an array of maps, so the answer provided did indeed answer the original question. The title was just worded incorrectly.

Is there something you're trying to figure out?

@4c74356b41
Copy link

yeah, was, but completely unrelated to this question (randomly got here).

@gm42
Copy link

gm42 commented Jul 27, 2022

I think an example on how to set a map via --set would be nice to have, couldn't find anything here: https://helm.sh/docs/chart_best_practices/values/

@igoratencompass
Copy link

igoratencompass commented Nov 29, 2023

In my experience in case the var is a bit more complex like:

someone:
  - name : ""
    surname : ""
    middlename: ""
    somelist: []

setting only the first two as per the example:

helm --set someone[0].name=mister,someone[0].surname=pompadur

wipes out the rest of the parameters as if they never existed converting the someone var into:

someone:
  - name : "mister"
    surname : "pompadur"

Example when using {{ range $i, $v := .Values.someone }} , {{ $v.middlename }} and {{ $v.somelist }} return null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants