cli - fix bug with Kubeconfig value resolution

This commit is contained in:
jpgouin
2025-03-04 10:23:54 +00:00
parent 2f582a473a
commit 1d027909ee
2 changed files with 6 additions and 4 deletions
+3 -1
View File
@@ -2,6 +2,7 @@ package cmds
import (
"fmt"
"os"
"github.com/rancher/k3k/pkg/apis/k3k.io/v1alpha1"
"github.com/rancher/k3k/pkg/buildinfo"
@@ -28,7 +29,8 @@ var (
EnvVars: []string{"KUBECONFIG"},
Usage: "kubeconfig path",
Destination: &Kubeconfig,
Value: "$HOME/.kube/config",
Value: os.Getenv("HOME") + "/.kube/config",
DefaultText: "$HOME/.kube/config",
},
&cli.StringFlag{
Name: "namespace",
+3 -3
View File
@@ -39,7 +39,7 @@ Create new cluster
**--cluster-cidr**="": cluster CIDR
**--kubeconfig**="": kubeconfig path (default: "$HOME/.kube/config")
**--kubeconfig**="": kubeconfig path (default: $HOME/.kube/config)
**--kubeconfig-server**="": override the kubeconfig server host
@@ -67,7 +67,7 @@ Delete an existing cluster
>k3kcli cluster delete [command options] NAME
**--kubeconfig**="": kubeconfig path (default: "$HOME/.kube/config")
**--kubeconfig**="": kubeconfig path (default: $HOME/.kube/config)
**--namespace**="": namespace to create the k3k cluster in
@@ -87,7 +87,7 @@ Generate kubeconfig for clusters
**--expiration-days**="": Expiration date of the certificates used for the kubeconfig (default: 356)
**--kubeconfig**="": kubeconfig path (default: "$HOME/.kube/config")
**--kubeconfig**="": kubeconfig path (default: $HOME/.kube/config)
**--kubeconfig-server**="": override the kubeconfig server host