From 80ffbfd423f988b14641ee38fc158919c45d8586 Mon Sep 17 00:00:00 2001 From: Stephen Beechen Date: Mon, 29 Jul 2024 23:46:28 -0600 Subject: [PATCH] feat: allow using external variables in export and env list (#1112) * Plumb JSonnetOpts to recursive export and env list * Lint: Remove extra newline Co-authored-by: Horst Gutmann --------- Co-authored-by: Horst Gutmann --- cmd/tk/env.go | 4 +++- cmd/tk/export.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/tk/env.go b/cmd/tk/env.go index dba9aba9f..3ad5270c5 100644 --- a/cmd/tk/env.go +++ b/cmd/tk/env.go @@ -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 @@ -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 } diff --git a/cmd/tk/export.go b/cmd/tk/export.go index f3d822e72..fc6896ce0 100644 --- a/cmd/tk/export.go +++ b/cmd/tk/export.go @@ -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 }