From c9289d736563a28994cc9ca17804444edf4168dc Mon Sep 17 00:00:00 2001 From: Wei Fu Date: Wed, 7 Feb 2024 06:26:26 +0000 Subject: [PATCH] virtualcluster/nodepool: read global flag Signed-off-by: Wei Fu --- cmd/kperf/commands/virtualcluster/nodepool.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/kperf/commands/virtualcluster/nodepool.go b/cmd/kperf/commands/virtualcluster/nodepool.go index 4f6b918..5273422 100644 --- a/cmd/kperf/commands/virtualcluster/nodepool.go +++ b/cmd/kperf/commands/virtualcluster/nodepool.go @@ -70,7 +70,7 @@ var nodepoolAddCommand = cli.Command{ return fmt.Errorf("required non-empty nodepool name") } - kubeCfgPath := cliCtx.String("kubeconfig") + kubeCfgPath := cliCtx.GlobalString("kubeconfig") affinityLabels, err := utils.KeyValuesMap(cliCtx.StringSlice("affinity")) if err != nil { @@ -103,7 +103,7 @@ var nodepoolDelCommand = cli.Command{ return fmt.Errorf("required non-empty nodepool name") } - kubeCfgPath := cliCtx.String("kubeconfig") + kubeCfgPath := cliCtx.GlobalString("kubeconfig") return virtualcluster.DeleteNodepool(context.Background(), kubeCfgPath, nodepoolName) }, @@ -113,7 +113,7 @@ var nodepoolListCommand = cli.Command{ Name: "list", Usage: "List virtual node pools", Action: func(cliCtx *cli.Context) error { - kubeCfgPath := cliCtx.String("kubeconfig") + kubeCfgPath := cliCtx.GlobalString("kubeconfig") nodepools, err := virtualcluster.ListNodepools(context.Background(), kubeCfgPath) if err != nil { return err