kube

package
v0.0.0-...-77b1a84 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMultipleClusters     = errors.New("cube: multiple clusters")
	ErrEmptyCluster         = errors.New("cube: empty cluster")
	ErrConfigAlreadyMerged  = errors.New("cube: kubeconfig already merged")
	ErrClusterAlreadyExists = errors.New("cube: cluster already exists")
	ErrContextAlreadyExists = errors.New("cube: context already exists")
	ErrUserAlreadyExists    = errors.New("cube: user already exists")

	ErrEmptyNameSuffix  = errors.New("cube: empty name-suffix for merge")
	ErrInvalidLocalPort = errors.New("cube: invalid local port for merge")
)
View Source
var (
	ErrClusterNotFound       = errors.New("cube: cluster not found for purging")
	ErrMultipleClustersFound = errors.New("cube: multiple clusters found for purging")
)

Functions

func LoadMainKC

func LoadMainKC() (*clientcmdapi.Config, error)

LoadMainKC loads main kube config - ~/.kube/config

Types

type Lister

type Lister interface {
	ListAllClusters() (model.ClusterInfos, error)
}

Lister lists all cluster info

type Merger

type Merger interface {
	Merge() error
	Result() *clientcmdapi.Config
	LocalPort() int
	RemoteAPIAddr() string
}

Merger merge another cluster config into local `~/.kube/config`

type PurgeOptions

type PurgeOptions struct {
	Name string
	All  bool
}

PurgeOptions represent options for purge.

type Purger

type Purger interface {
	Purge() error
	Result() *clientcmdapi.Config
	Deleted() []string
}

Purger deletes Kubernetes configs under given conditions

func NewPurger

func NewPurger(opts PurgeOptions) Purger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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