Import all environment variables as Data Values
- Dominant language
- Go
- Stars
- 1.9k
- Forks
- 167
- PR merge metrics
- No merged PRs in 30d
Description
Started as a discussion in [#carvel](https://kubernetes.slack.com/archives/CH8KCCKA5/p1650410088599709) by @GrahamDumpleton
**Describe the problem/challenge you have**
When using ytt one can use the `--data-values-env` option to import as data values all environment variables starting with a designated prefix. In doing that, it will strip the prefix.
What I can't seem to find is an easy way of saying just import the whole set of environment variables in, and leave the full names of the environment variables as is.
In other words, the keys in `data.values` would be the full environment variable names.
**Describe the solution you'd like**
What I am ultimately wanting to do is use ytt as a more power equivalent to `envsubst`
**Anything else you would like to add:**
Suggestions? Note that it needs to deal with fact that if run env and capture it in a file, values which cover multiple lines become a problem if have to parse it yourself.
Thus a `--data-values-env-all` or similar would be nice which imports all environment variables.
---
Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.
Contributor guide
Research direction
Start by tracing ytt's existing --data-values-env option and how its CLI data values are assembled. Define the behavior for a new all-environment-variables option, including preserving full variable names and handling multiline values, then verify that the resulting data.values can drive envsubst-like templating.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100