plugin

package
v0.6.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 24 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 {
	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 (kc *KubeConfig) CreateContext(ctx context.Context, name string, overwrite bool) error

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

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