feat(main): Support specifying kubectl args in ResourceSets
This commit is contained in:
parent
5f433c46c1
commit
54db9785d6
6 changed files with 61 additions and 2 deletions
6
main.go
6
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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue