diff options
author | Martin Lehmann <martin@folio.no> | 2018-11-15T12·49+0100 |
---|---|---|
committer | Vincent Ambo <github@tazj.in> | 2018-12-11T09·58+0100 |
commit | 54db9785d65d8a9dfc78d1cf230810b19f1abffb (patch) | |
tree | fcbfd470aaf794ca21bcd2a5ccc1a9dac66a3c12 /main.go | |
parent | 5f433c46c16f4466ad17578eb1762399aa7746d1 (diff) |
feat(main): Support specifying kubectl args in ResourceSets
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/main.go b/main.go index 6dacc5275866..3d20adde379e 100644 --- a/main.go +++ b/main.go @@ -199,7 +199,7 @@ func loadContextAndResources(file *string) (*context.Context, *[]templater.Rende } func runKubectlWithResources(c *context.Context, kubectlArgs *[]string, resourceSets *[]templater.RenderedResourceSet) error { - args := append(*kubectlArgs, fmt.Sprintf("--context=%s", c.Name)) + argsWithContext := append(*kubectlArgs, fmt.Sprintf("--context=%s", c.Name)) for _, rs := range *resourceSets { if len(rs.Resources) == 0 { @@ -207,7 +207,9 @@ func runKubectlWithResources(c *context.Context, kubectlArgs *[]string, resource continue } - kubectl := exec.Command(*kubectlBin, args...) + argsWithResourceSetArgs := append(argsWithContext, rs.Args...) + + kubectl := exec.Command(*kubectlBin, argsWithResourceSetArgs...) stdin, err := kubectl.StdinPipe() if err != nil { |