Skip to content

Commit

Permalink
feat: allow using external variables in export and env list (#1112)
Browse files Browse the repository at this point in the history
* Plumb JSonnetOpts to recursive export and env list

* Lint: Remove extra newline

Co-authored-by: Horst Gutmann <[email protected]>

---------

Co-authored-by: Horst Gutmann <[email protected]>
  • Loading branch information
sabeechen and zerok authored Jul 30, 2024
1 parent 2f62276 commit 80ffbfd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/tk/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ func envListCmd() *cli.Command {

useNames := cmd.Flags().Bool("names", false, "plain names output")

getJsonnetOpts := jsonnetFlags(cmd.Flags())

cmd.Run = func(cmd *cli.Command, args []string) error {
var path string
var err error
Expand All @@ -253,7 +255,7 @@ func envListCmd() *cli.Command {
}
}

envs, err := tanka.FindEnvs(path, tanka.FindOpts{Selector: getLabelSelector()})
envs, err := tanka.FindEnvs(path, tanka.FindOpts{Selector: getLabelSelector(), JsonnetOpts: getJsonnetOpts()})
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/tk/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func exportCmd() *cli.Command {
// find possible environments
if *recursive {
// get absolute path to Environment
envs, err := tanka.FindEnvsFromPaths(args[1:], tanka.FindOpts{Selector: opts.Selector, Parallelism: opts.Parallelism})
envs, err := tanka.FindEnvsFromPaths(args[1:], tanka.FindOpts{Selector: opts.Selector, Parallelism: opts.Parallelism, JsonnetOpts: opts.Opts.JsonnetOpts})
if err != nil {
return err
}
Expand Down

0 comments on commit 80ffbfd

Please sign in to comment.