You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Does chart support numeric conversion tuple syntax? #4876
I think you want something like a loop. I am not sure of a way to do that today. It might be a good function for Sprig, the template function package Helm uses.
You can also define the intervals using three arguments: seq $BEGIN $INTERVAL $END. seq 0 1 3 would return the list 0 1 2 3, whereas seq 0 2 10 would return 0 2 4 6 8 10.
I think a function that performs similar to seq would be a great enhancement to sprig.
For the time being, you can use list 0 1 2 to achieve the same effect.
Activity
mattfarina commentedon Nov 2, 2018
Helm uses the go template syntax.
rangeis part of that. You can read about it in the go documentation (e.g., https://golang.org/pkg/text/template/). Does that help?ygqygq2 commentedon Nov 5, 2018
@mattfarina I've read it, but there's no range loop like I said.So I'm here to ask for help.
mattfarina commentedon Nov 5, 2018
Half way through the variables section it touches on range. See https://golang.org/pkg/text/template/#hdr-Variables. Does that not work for you?
ygqygq2 commentedon Nov 6, 2018
@mattfarina Thanks.
I mean, if give a number
3, then can get a list[0, 1, 2].mattfarina commentedon Nov 6, 2018
I think you want something like a loop. I am not sure of a way to do that today. It might be a good function for Sprig, the template function package Helm uses.
bacongobbler commentedon Nov 6, 2018
yeah, bash has a command called
seqthat takes a number and returns a sequence of numbers up to and including that number, starting at 1: http://tldp.org/LDP/abs/html/extmisc.htmlYou can also define the intervals using three arguments:
seq $BEGIN $INTERVAL $END.seq 0 1 3would return the list0 1 2 3, whereasseq 0 2 10would return0 2 4 6 8 10.I think a function that performs similar to
seqwould be a great enhancement to sprig.For the time being, you can use
list 0 1 2to achieve the same effect.ygqygq2 commentedon Nov 7, 2018
@mattfarina @bacongobbler Thanks a lot.
Yes, your are right.
http://masterminds.github.io/sprig/integer_slice.html
{{ untilStep 0 3 1 }}can get[0 1 2]bacongobbler commentedon Nov 7, 2018
I filed Masterminds/sprig#124 to track this upstream. If you feel like contributing that function @ygqygq2, we'd really appreciate a PR.
lentil1016 commentedon Nov 29, 2018
{{ untilStep 0 3 1 }}works for now.will produce
I wonder if it's a good idea to add this example to
control_structures.md. It seems sort of a commonly used looping form to me. 🤔dominik-ba commentedon Aug 28, 2019
For me it looks like this does not work with values.
This example just prints out
ports:and nothing else ...values.yaml contains this
Am I doing something wrong or is this not supported?
ygqygq2 commentedon Aug 29, 2019
@dominik-ba

dominik-ba commentedon Aug 29, 2019
Ok that was embarrassing... :D thanks alot!
Maybe it would be good if there was an error instead of nothing printed in this case...
Thanks anyways :)