Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var KubeCmd = &cobra.Command{ Use: "kube", Aliases: []string{"k8s", "clusters"}, Short: "Access Kubernetes clusters", Long: `View the Kubernetes clusters registered in the workspace, and log in to one so kubectl reaches it under a WorkSession that targets the cluster. Clusters are registered by the agent running inside each cluster, not from the CLI. This group appears only when the server reports that Kubernetes support is enabled for the workspace; 'alpacon login' and 'alpacon workspace switch' refresh that answer.`, Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return utils.RequireSubcommand(cmd) }, }
Functions ¶
func ApplySurfaceGate ¶
ApplySurfaceGate replaces KubeCmd under root with a hidden stand-in when the workspace has not reported the Kubernetes surface. It must run before root.Execute: Cobra answers --help and validates arguments before any PreRun hook, and decides suggestions and completion from Hidden alone. Swapping the command leaves the enabled tree exactly as built.
This is a courtesy, not a control: the server refuses /api/kubernetes/ on its own whenever the surface is off.
kube credentials stays reachable under the stand-in. kubectl runs it for a context an earlier login wrote, perhaps in another workspace or before a logout, and it reads only the saved session, so the current workspace's answer says nothing about it. kube logout stays for the same reason: it cleans up such a context and its saved token, and needs the server only for a best-effort close.
Types ¶
This section is empty.