RFE: Adding array items with from the command line
- Dominant language
- Go
- Stars
- 1.9k
- Forks
- 167
- PR merge metrics
- No merged PRs in 30d
Description
I have a file `values.yml` that looks like this:
```
#@data/values
---
namespace: default
flavor: medium
disk: 10Gi
ssh_keys: []
```
I would like someone running `ytt` to be able to easily append values to the `ssh_keys` array from the command line (without having to write a YAML list inline). I was envisioning something like this:
```
ytt -f template.yml \
--data-value-file ssh_keys+=$HOME/.ssh/id_rsa_foo.pub \
--data-value-file ssh_keys+=$HOME/.ssh/id_rsa_bar.pub
```
That is, use `+=` to indicate "append to list", rather than trying to set a key on a mapping. Does that seem reasonable?
Contributor guide
Research direction
Start at the ytt command-line handling for --data-value-file, using the values.yml example and template.yml invocation as the behavioral reference. Check how repeated options and ssh_keys: [] are currently processed; done means += appends each supplied file's value to ssh_keys without requiring an inline YAML list.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, yaml
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100