Skip to content

Get placeholder array from index #5202

@davidpanic

Description

@davidpanic

I would like to be able to get placeholder values like some programming languages allow to with "rest" arguments. Perhaps it's best explained with an example:

(myservice) {
    {args.0}.some.domain {
        reverse_proxy {args.1...} {
            ...a ton of options that I don't want to repeat
        }
    }
}

import myservice service.a http://192.168.60.1:8081 http://192.168.60.2:8081 http://192.168.60.3:8081
import myservice service.b http://192.168.60.4:8181 http://192.168.60.5:8181

As you can see there's a different amount of arguments (in this case upstream URLs) defined in the import and I want to just specify them all for the reverse proxy upstreams.

To my knowledge there is currently no way to do this, you must specify the arguments by index which doesn't work for variable length arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions