-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add structured support for external and top-level variables in qbec, f…
…ixes #4 (#10) Refactor the options structs and interfaces such that config is now created in the commands package. This allows for a single implmentation for real code and tests such that the newly introduced interactions between VM config and app can be handled in one place and tested. Add a `vars` section in qbec.yaml that allows definition of external and top-level variables. External variables can have defaults that are used when not specified on the command line. Top level variables must be associated with components such that these are only set for the components that need them. Add `-V` and `-A` shorthands (similar to `jsonnet eval`) to set string vars for external and top-level variables from the command line. Code values are also supported but do not have short flags for assigment. Introduce a `--strict-vars` flag that restricts commands from only setting up variables that are defined in qbec and requires them to set _all_ such variables at the time of command invocation.
- Loading branch information
1 parent
a5dd69e
commit 2ae3674
Showing
37 changed files
with
1,283 additions
and
457 deletions.
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
local objects = import 'objects.libsonnet'; | ||
local fooValue = std.extVar('externalFoo'); | ||
|
||
{ | ||
configMap: objects.configmap('foo-system','svc1-cm', { foo : 'bar' }), | ||
configMap: objects.configmap('foo-system','svc1-cm', { foo : fooValue }), | ||
} |
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
local objects = import 'objects.libsonnet'; | ||
|
||
{ | ||
configMap: objects.configmap('bar-system','svc2-cm', { foo : 'bar' }), | ||
secret: objects.secret('bar-system','svc2-secret', { foo : std.base64('bar') }), | ||
} | ||
function (tlaFoo = 'bar') ( | ||
{ | ||
configMap: objects.configmap('bar-system','svc2-cm', { foo : tlaFoo }), | ||
secret: objects.secret('bar-system','svc2-secret', { foo : std.base64('bar') }), | ||
} | ||
) | ||
|
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
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
Oops, something went wrong.