You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -240,6 +240,22 @@ var listCmd = &cobra.Command{
240
240
},
241
241
}
242
242
243
+
varlistCtxCmd=&cobra.Command{
244
+
Use: "list",
245
+
Short: "List all available contexts",
246
+
Long: `List all available contexts in the kubeconfig file`,
247
+
Args: cobra.ExactArgs(0),
248
+
Run: func(cmd*cobra.Command, args []string) {
249
+
cp:= cont.CPCtx{
250
+
CP: common.CP{
251
+
Ctx: createContext(),
252
+
Kubeconfig: kubeconfig,
253
+
},
254
+
}
255
+
cp.ListContexts()
256
+
},
257
+
}
258
+
243
259
funcinit() {
244
260
versionCmd.Flags().StringVarP(&kubeconfig, "kubeconfig", "k", "", "path to the kubeconfig file for the KubeFlex hosting cluster. If not specified, and $KUBECONFIG is set, it uses the value in $KUBECONFIG, otherwise it falls back to ${HOME}/.kube/configg")
245
261
versionCmd.Flags().BoolVarP(&chattyStatus, "chatty-status", "s", true, "chatty status indicator")
@@ -281,6 +297,7 @@ func init() {
281
297
ctxCmd.Flags().BoolVarP(&setCurrentCtxAsHosting, "set-current-for-hosting", "c", false, "Set current context as hosting cluster context")
0 commit comments