plugin

package
v0.3.0-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

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

func (*Options) BindFlags

func (o *Options) BindFlags(cmd *cobra.Command)

BindFlags binds the arguments common to all sub-commands, to the corresponding main command flags

func (*Options) Validate added in v0.6.0

func (o *Options) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL