feat(main): Support specifying kubectl args in ResourceSets

This commit is contained in:
Martin Lehmann 2018-11-15 13:49:23 +01:00 committed by Vincent Ambo
parent 5f433c46c1
commit 54db9785d6
6 changed files with 61 additions and 2 deletions

View file

@ -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 {