Skip to content
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

feat(cli): extVars #178

Merged
merged 1 commit into from
Jan 21, 2020
Merged

feat(cli): extVars #178

merged 1 commit into from
Jan 21, 2020

Conversation

sh0rez
Copy link
Member

@sh0rez sh0rez commented Jan 21, 2020

Adds two flags for working with extVars:

  • -e / --extCode: Allows to bind any Jsonnet value (anything) to the
    extVar. This flag is superior to --extVar, because it also handles
    ints, bools, objects and arrays. Strings need to be quoted.

  • --extVar: Only strings, but takes them unqouted. Added for
    compatibility reasons to jsonnet.

Fixes #168 and Closes #171

Adds two flags for working with extVars:

- `-e` / `--extCode`: Allows to bind any Jsonnet value (anything) to the
  extVar. This flag is superior to `--extVar`, because it also handles
  ints, bools, objects and arrays. **Strings need to be quoted**.

- `--extVar`: Only strings, but takes them unqouted. Added for
compatibility reasons to `jsonnet`.
@sh0rez sh0rez added kind/feature Something new should be added component/cli Command Line Interface component/jsonnet Everything regarding the jsonnet language labels Jan 21, 2020
@sh0rez sh0rez requested a review from rfratto January 21, 2020 18:21
Copy link
Member

@rfratto rfratto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM!

// Eval returns the raw evaluated Jsonnet and the parsed env used for evaluation
func Eval(baseDir string, opts *options) (raw map[string]interface{}, env *v1alpha1.Config, err error) {
// Eval returns the raw evaluated Jsonnet output (without any transformations)
func Eval(baseDir string, mods ...Modifier) (raw map[string]interface{}, err error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is even better than before, where an exported function was using an unexported type :)

@sh0rez sh0rez merged commit a583e3b into master Jan 21, 2020
@sh0rez sh0rez deleted the extCode branch January 21, 2020 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/cli Command Line Interface component/jsonnet Everything regarding the jsonnet language kind/feature Something new should be added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nativeFunc plugins Support extVars
2 participants