Documentation ¶
Index ¶
- type KubeConfig
- func (kc *KubeConfig) CreateWorkspace(ctx context.Context, opts *Options, workspaceName string, ...) error
- func (kc *KubeConfig) CurrentWorkspace(ctx context.Context, opts *Options) error
- func (kc *KubeConfig) DeleteWorkspace(ctx context.Context, opts *Options, workspaceName string) error
- func (kc *KubeConfig) ListWorkspaces(ctx context.Context, opts *Options) error
- func (kc *KubeConfig) UseWorkspace(ctx context.Context, opts *Options, requestedWorkspaceName string) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KubeConfig ¶
type KubeConfig struct {
// contains filtered or unexported fields
}
KubeConfig contains a config loaded from a Kubeconfig and allows modifications on it through workspace-related actions
func NewKubeConfig ¶
func NewKubeConfig(opts *Options) (*KubeConfig, error)
NewKubeConfig load a kubeconfig with default config access
func (*KubeConfig) CreateWorkspace ¶
func (kc *KubeConfig) CreateWorkspace(ctx context.Context, opts *Options, workspaceName string, useAfterCreation bool, wsType string) error
CreateWorkspace creates a workspace owned by the the current user (kubeconfig user possibly overridden by CLI options).
func (*KubeConfig) CurrentWorkspace ¶
func (kc *KubeConfig) CurrentWorkspace(ctx context.Context, opts *Options) error
CurrentWorkspace outputs the current workspace.
func (*KubeConfig) DeleteWorkspace ¶
func (kc *KubeConfig) DeleteWorkspace(ctx context.Context, opts *Options, workspaceName string) error
DeleteWorkspace deletes a workspace owned by the the current user (kubeconfig user possibly overridden by CLI options).
func (*KubeConfig) ListWorkspaces ¶
func (kc *KubeConfig) ListWorkspaces(ctx context.Context, opts *Options) error
ListWorkspaces outputs the list of workspaces of the current user (kubeconfig user possibly overridden by CLI options).
func (*KubeConfig) UseWorkspace ¶
func (kc *KubeConfig) UseWorkspace(ctx context.Context, opts *Options, requestedWorkspaceName string) error
UseWorkspace switch the current workspace to the given workspace. To do so it retrieves the ClusterWorkspace minimal KubeConfig (mainly cluster infos) from the `workspaces` virtual workspace `workspaces/kubeconfig` sub-resources, and adds it (along with the Auth info that is currently used) to the Kubeconfig. Then it make this new context the current context.
type Options ¶
type Options struct { KubectlOverrides *clientcmd.ConfigOverrides Scope string genericclioptions.IOStreams }
Options provides options that will drive the update of the current context on a user's KUBECONFIG based on actions done on KCP workspaces
func NewOptions ¶
func NewOptions(streams genericclioptions.IOStreams) *Options
NewOptions provides an instance of Options with default values