-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add variables support #511
Conversation
…default param values
myParameter: | ||
type: string | ||
# the use of `concat()` here is just an example of using an expression for a defaultValue | ||
defaultValue: "[concat('world','!')]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a difference between parameters and variables:
parameters have 2 subfields: type
and defaultValue
,
but looks like variables have just implied defaultValue
and type is implicitly derived.
Should this be consistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took this directly from ARM. variables
are intended to just be used to keep values that get reused multiple times within the config and typically constructed from params based on examples I saw.
$out.results[0].result.actualState.output | Should -Be 'bar' | ||
} | ||
|
||
It 'Missing variable returns error' { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The essence of a variable
in any language is that it's value can be changed; I don't see such example or tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct, but that's not how it's used in an ARM template
PR Summary
Add ability to have
variables
section in config andvariables()
function implementation. Note that due to how serde works by default, duplicates don't error and last one wins (created #510)Also added some additional debug tracing to parser to understand why array indexing didn't work. Turns out I missed implementing it #509
PR Context
Part of #57