This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 327
Allow dynamic configuration as a default for input variables #2889
Merged
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
472025e
internal/config: new dynamic package for configdynamic func call
mitchellh 94a5a87
internal/config: default var value can be dynamic, doesn't WORK yet
mitchellh 9015a0e
internal/config: load variables from config sources
mitchellh e6c3ba1
internal/runner: load dynamic defaults
mitchellh 65728dd
internal/runner: dynamic defaults require remote runners
mitchellh cde1f42
internal/appconfig: protect against unknown plugin
mitchellh b5959d9
internal/config: test evaluating dynamic configs
mitchellh 6b8fc37
fmt
mitchellh a4eb298
internal/server: always send down all config sources to runner
mitchellh 35b4034
internal/server: whitespace
mitchellh 96cb8dd
builtin/null
mitchellh 537c36a
gen website
mitchellh eb4cdb3
internal/config: don't set dynamics as defaults during eval
mitchellh b90f897
internal/config: fix test
mitchellh 0bea5a5
builtin/null: decode using mapstructure
mitchellh ddaeb03
changelog
mitchellh 1f9a45a
internal/config/variables: log after timer
mitchellh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
variable "rate" { | ||
default = configdynamic("vault", {}) | ||
type = number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 was wondering how you'd handle types - requiring an hcl conversion is a good idea for now I think, and we can do fancier typing in the future if we want to. I was kind of dreading handling the
object
type.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 think strings are the way to go.
For numerics, HCL is arbitrary precision numbers too so any floats will work fine and easy to convert.
For boolean, easy to use
tobool
(usesstrconv.parseBool
)For objects, easy to use
yamldecode
jsondecode
jsonnetdecode
etc. depending on format, and easy to add new format support if they have it.