Skip to content

feature request: seq #124

Closed
Closed

Description

@bacongobbler

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

Activity

  1. changed the title [-]feature request: `seq` function[/-] [+]feature request: `seq`[/+] on Nov 7, 2018
  2. Dean-Coakley commented on Nov 18, 2018

    @Dean-Coakley
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions