Documentation ¶
Index ¶
- type KubeConfig
- func (kc *KubeConfig) CreateContext(ctx context.Context, name string, overwrite bool) error
- func (kc *KubeConfig) CreateWorkspace(ctx context.Context, workspaceName string, workspaceType string, ...) error
- func (kc *KubeConfig) CurrentWorkspace(ctx context.Context) error
- func (kc *KubeConfig) ListWorkspaces(ctx context.Context, opts *Options) error
- func (kc *KubeConfig) UseWorkspace(ctx context.Context, name string) (err error)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KubeConfig ¶
type KubeConfig struct { genericclioptions.IOStreams // 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) CreateContext ¶ added in v0.6.0
func (*KubeConfig) CreateWorkspace ¶
func (kc *KubeConfig) CreateWorkspace(ctx context.Context, workspaceName string, workspaceType string, ignoreExisting, useAfterCreation bool, readyWaitTimeout time.Duration) 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) error
CurrentWorkspace outputs the current workspace.
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, name string) (err 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 ShortWorkspaceOutput bool 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