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

feature request: seq #124

Closed
bacongobbler opened this issue Nov 7, 2018 · 1 comment · Fixed by #205
Closed

feature request: seq #124

bacongobbler opened this issue Nov 7, 2018 · 1 comment · Fixed by #205

Comments

@bacongobbler
Copy link
Contributor

bacongobbler commented Nov 7, 2018

bash has a command called seq that takes a number and returns a sequence of numbers up to and including that number, starting from 1.

You can also define the intervals using two additional (optional) arguments: seq $BEGIN $INTERVAL $END. For example, 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, as one could use it in templates via the following:

It's as easy as {{ seq 3 }}!

Docs for seq can be found here: http://tldp.org/LDP/abs/html/extmisc.html

For the time being, you can use list 1 2 3 to achieve the same effect.

ref: helm/helm#4876

@bacongobbler bacongobbler changed the title feature request: seq function feature request: seq Nov 7, 2018
@Dean-Coakley
Copy link
Contributor

Just wanted to let you know I've started work on this feature.
So far I think it works pretty well but the code is not nice, not used to programming so heavily to interfaces. So I'll try improve before opening a PR.

Hopefully creating seq.go is correct

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

Successfully merging a pull request may close this issue.

3 participants