| 425 | } |
| 426 | |
| 427 | func (d *diffCmd) writeExistingValues(f *os.File, all bool) error { |
| 428 | args := []string{"get", "values", d.release, "--output", "yaml"} |
| 429 | if all { |
| 430 | args = append(args, "--all") |
| 431 | } |
| 432 | if d.namespace != "" { |
| 433 | args = append(args, "--namespace", d.namespace) |
| 434 | } |
| 435 | if d.kubeContext != "" { |
| 436 | args = append(args, "--kube-context", d.kubeContext) |
| 437 | } |
| 438 | cmd := exec.Command(os.Getenv("HELM_BIN"), args...) |
| 439 | debugPrint("Executing %s", strings.Join(cmd.Args, " ")) |
| 440 | defer func() { |
| 441 | _ = f.Close() |
| 442 | }() |
| 443 | cmd.Stdout = f |
| 444 | return cmd.Run() |
| 445 | } |
| 446 | |
| 447 | func extractManifestFromHelmUpgradeDryRunOutput(s []byte, noHooks bool) []byte { |
| 448 | if len(s) == 0 { |