Skip to content

Commit

Permalink
virtualcluster/nodepool: read global flag
Browse files Browse the repository at this point in the history
Signed-off-by: Wei Fu <[email protected]>
  • Loading branch information
fuweid committed Feb 7, 2024
1 parent 5ad18fe commit c9289d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/kperf/commands/virtualcluster/nodepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
},
Expand All @@ -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
Expand Down

0 comments on commit c9289d7

Please sign in to comment.