From d1bb074680b847de150051e56f21b82250cdafa0 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Sat, 9 Nov 2024 21:11:45 +0100 Subject: [PATCH] fix(clustertool): ensure kubeconfig is created with force true by default --- clustertool/cmd/talos_apply.go | 2 +- clustertool/cmd/talos_upgrade.go | 2 +- clustertool/pkg/gencmd/bootstrap.go | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/clustertool/cmd/talos_apply.go b/clustertool/cmd/talos_apply.go index 1b8742582b17..486b20c42cb9 100644 --- a/clustertool/cmd/talos_apply.go +++ b/clustertool/cmd/talos_apply.go @@ -109,7 +109,7 @@ func RunApply(kubeconfig bool, node string, extraArgs []string) { gencmd.ExecCmds(taloscmds, true) if kubeconfig { - kubeconfigcmds := gencmd.GenPlain("kubeconfig", helper.TalEnv["VIP_IP"], extraArgs) + kubeconfigcmds := gencmd.GenPlain("kubeconfig", helper.TalEnv["VIP_IP"], []string{"-f"}) gencmd.ExecCmd(kubeconfigcmds[0]) } diff --git a/clustertool/cmd/talos_upgrade.go b/clustertool/cmd/talos_upgrade.go index 9a30c700289c..5d607218a386 100644 --- a/clustertool/cmd/talos_upgrade.go +++ b/clustertool/cmd/talos_upgrade.go @@ -55,7 +55,7 @@ var upgrade = &cobra.Command{ gencmd.ExecCmd(kubeUpgradeCmd) log.Info().Msg("(re)Loading KubeConfig)") - kubeconfigcmds := gencmd.GenPlain("health", helper.TalEnv["VIP_IP"], extraArgs) + kubeconfigcmds := gencmd.GenPlain("health", helper.TalEnv["VIP_IP"], []string{"-f"}) gencmd.ExecCmd(kubeconfigcmds[0]) }, diff --git a/clustertool/pkg/gencmd/bootstrap.go b/clustertool/pkg/gencmd/bootstrap.go index dd75eb721702..d3aad69e18c5 100644 --- a/clustertool/pkg/gencmd/bootstrap.go +++ b/clustertool/pkg/gencmd/bootstrap.go @@ -55,7 +55,8 @@ func RunBootstrap(args []string) { log.Info().Msgf("Bootstrap: Configuring kubeconfig/kubectl for VIP: %v", helper.TalEnv["VIP_IP"]) // Ensure kubeconfig is loaded - kubeconfigcmds := GenPlain("kubeconfig", helper.TalEnv["VIP_IP"], extraArgs) + + kubeconfigcmds := GenPlain("kubeconfig", helper.TalEnv["VIP_IP"], []string{"-f"}) ExecCmd(kubeconfigcmds[0]) // Desired pod names