Use envsubst
with yq variable
#2369
Unanswered
robross0606
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a situation where I need to use an environment variable if not blank, or default to using a parsed
yq
variable if the environment variable is not set. I looked atstrenv
,env
andenvsubst
. I would use the//
alternative operator, but the environment variable would probably be blank and notnull
.envsubst
looks like it might fit the bill other than that I'm not sure of the syntax for referencing theyq
variable as the default.Where
GITOPS_BRANCH_OVERRIDE
is an environment variable anditem
is ayq
variable, would something like this work?Beta Was this translation helpful? Give feedback.
All reactions