mirror of
https://github.com/fluxcd/flux2.git
synced 2026-05-05 01:28:52 +00:00
Set kubecontext and kubeconfig for kubectl exec
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
371db07108
commit
c02fbc2794
5 changed files with 19 additions and 11 deletions
|
|
@ -144,7 +144,7 @@ func uninstallCmdRun(cmd *cobra.Command, args []string) error {
|
|||
if uninstallDryRun {
|
||||
kubectlArgs = append(kubectlArgs, dryRun)
|
||||
}
|
||||
if _, err := utils.ExecKubectlCommand(ctx, utils.ModeOS, kubectlArgs...); err != nil {
|
||||
if _, err := utils.ExecKubectlCommand(ctx, utils.ModeOS, kubeconfig, kubecontext, kubectlArgs...); err != nil {
|
||||
return fmt.Errorf("uninstall failed: %w", err)
|
||||
}
|
||||
}
|
||||
|
|
@ -164,6 +164,6 @@ func deleteAll(ctx context.Context, kind string, dryRun bool) error {
|
|||
kubectlArgs = append(kubectlArgs, "--dry-run=server")
|
||||
}
|
||||
|
||||
_, err := utils.ExecKubectlCommand(ctx, utils.ModeOS, kubectlArgs...)
|
||||
_, err := utils.ExecKubectlCommand(ctx, utils.ModeOS, kubeconfig, kubecontext, kubectlArgs...)
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue