From b85f0633b7decadd4506af91cc83281d6d77edd3 Mon Sep 17 00:00:00 2001 From: Stephen Beechen Date: Wed, 24 Jul 2024 15:39:11 -0600 Subject: [PATCH 1/2] Plumb JSonnetOpts to recursive export and env list --- cmd/tk/env.go | 4 +++- cmd/tk/export.go | 3 ++- 2 files changed, 5 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..11baa03c2 100644 --- a/cmd/tk/export.go +++ b/cmd/tk/export.go @@ -88,8 +88,9 @@ func exportCmd() *cli.Command { var exportEnvs []*v1alpha1.Environment // 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 } From 4f0b377d03aa12a67c21be31b666e1a271ef601f Mon Sep 17 00:00:00 2001 From: Stephen Beechen Date: Mon, 29 Jul 2024 08:50:27 -0600 Subject: [PATCH 2/2] Lint: Remove extra newline Co-authored-by: Horst Gutmann --- cmd/tk/export.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/tk/export.go b/cmd/tk/export.go index 11baa03c2..fc6896ce0 100644 --- a/cmd/tk/export.go +++ b/cmd/tk/export.go @@ -88,7 +88,6 @@ func exportCmd() *cli.Command { var exportEnvs []*v1alpha1.Environment // find possible environments if *recursive { - // get absolute path to Environment envs, err := tanka.FindEnvsFromPaths(args[1:], tanka.FindOpts{Selector: opts.Selector, Parallelism: opts.Parallelism, JsonnetOpts: opts.Opts.JsonnetOpts}) if err != nil {