about summary refs log tree commit diff
path: root/main.go
diff options
context:
space:
mode:
authorMartin Lehmann <martin@folio.no>2018-11-15T12·49+0100
committerVincent Ambo <github@tazj.in>2018-12-11T09·58+0100
commit54db9785d65d8a9dfc78d1cf230810b19f1abffb (patch)
treefcbfd470aaf794ca21bcd2a5ccc1a9dac66a3c12 /main.go
parent5f433c46c16f4466ad17578eb1762399aa7746d1 (diff)
feat(main): Support specifying kubectl args in ResourceSets
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
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 {