ctx

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OverwriteExistingContextFlag = "overwrite-existing-context"
	SetCurrentForHostingFlag     = "set-current-for-hosting"
)
View Source
const (
	SwitchCtxFlag = "switch"
)

Variables

This section is empty.

Functions

func Command added in v0.8.6

func Command() *cobra.Command

func CommandDelete added in v0.8.8

func CommandDelete() *cobra.Command

func CommandGet added in v0.8.6

func CommandGet() *cobra.Command

func CommandList added in v0.8.6

func CommandList() *cobra.Command

func CommandRename added in v0.8.8

func CommandRename() *cobra.Command

Command kflex ctx rename

func ExecuteCtxDelete added in v0.8.8

func ExecuteCtxDelete(cp common.CP, ctxName string, chattyStatus bool, options ...DeleteOption) error

Execute kflex ctx delete

func ExecuteCtxGet added in v0.8.6

func ExecuteCtxGet(cp common.CP)

func ExecuteCtxList added in v0.8.6

func ExecuteCtxList(cp common.CP)

func ExecuteCtxRename added in v0.8.8

func ExecuteCtxRename(cp common.CP, ctxName string, newCtxName string, toSwitch bool) error

Execute kflex ctx rename command

Types

type BasicTable added in v0.9.1

type BasicTable struct {
	Rows []BasicTableRow
}

BasicTable implements Printer and fmt.Stringer for table output.

func NewBasicTablePrinter added in v0.9.1

func NewBasicTablePrinter(config *api.Config, currentContext string) BasicTable

NewBasicTablePrinter constructs a BasicTable from kubeconfig and current context.

func (BasicTable) Content added in v0.9.1

func (b BasicTable) Content() string

Content returns the formatted table rows for BasicTable.

func (BasicTable) Header added in v0.9.1

func (b BasicTable) Header() string

Header returns the table header for BasicTable.

func (BasicTable) String added in v0.9.1

func (b BasicTable) String() string

type BasicTableRow added in v0.9.1

type BasicTableRow struct {
	Prefix  string
	CtxName string
	IsKflex string
	CPName  string
}

BasicTableRow represents a row in the context list table.

type CPCtx

type CPCtx struct {
	common.CP
	Type tenancyv1alpha1.ControlPlaneType
	// contains filtered or unexported fields
}

func (*CPCtx) ExecuteCtx added in v0.8.6

func (cpCtx *CPCtx) ExecuteCtx(chattyStatus, failIfNone, overwriteExistingCtx, setCurrentCtxAsHosting bool) error

Context switch context in Kubeconfig

type DeleteOption added in v0.9.1

type DeleteOption func(*DeleteOptions)

func WithForce added in v0.9.1

func WithForce() DeleteOption

WithForce sets the force option to bypass confirmation

type DeleteOptions added in v0.9.1

type DeleteOptions struct {
	Force bool
}

type Printer added in v0.9.1

type Printer interface {
	Header() string
	Content() string
}

Printer interface for output formatting

Jump to

Keyboard shortcuts

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