From f5267c6ba1a52795e931067cd9678877a602d249 Mon Sep 17 00:00:00 2001 From: Kimmo Lehto Date: Tue, 22 Aug 2023 09:57:07 +0300 Subject: [PATCH] Back to env Signed-off-by: Kimmo Lehto --- pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster/host.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster/host.go b/pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster/host.go index c5847fdd..76295bb1 100644 --- a/pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster/host.go +++ b/pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster/host.go @@ -237,7 +237,7 @@ func (h *Host) K0sCmdf(template string, args ...any) string { // KubectlCmdf returns a command line in sprintf manner for running kubectl on the host using the kubeconfig from KubeconfigPath func (h *Host) KubectlCmdf(s string, args ...any) string { - return h.K0sCmdf(`kubectl --kubeconfig=%s %s`, h.KubeconfigPath(), fmt.Sprintf(s, args...)) + return fmt.Sprintf("env KUBECONFIG=%s %s", h.KubeconfigPath(), h.K0sCmdf(`kubectl %s`, fmt.Sprintf(s, args...))) } // K0sConfigPath returns the config file path from install flags or configurer @@ -436,8 +436,7 @@ type kubeNodeStatus struct { // KubeNodeReady runs kubectl on the host and returns true if the given node is marked as ready func (h *Host) KubeNodeReady() (bool, error) { - //output, err := h.ExecOutput(h.KubectlCmdf("get node -l kubernetes.io/hostname=%s -o json", h.Metadata.Hostname), exec.HideOutput(), exec.Sudo(h)) - output, err := h.ExecOutput(h.KubectlCmdf("get node -l kubernetes.io/hostname=%s -o json", h.Metadata.Hostname), exec.Sudo(h)) + output, err := h.ExecOutput(h.KubectlCmdf("get node -l kubernetes.io/hostname=%s -o json", h.Metadata.Hostname), exec.HideOutput(), exec.Sudo(h)) if err != nil { return false, err }