ns

package
v0.0.0-...-fe26432 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListNamespaces

func ListNamespaces(kubeconfigPathFromFlag, stateDir string, noIndex bool) ([]string, error)

ListNamespaces retrieves all available namespaces (either via API call or from local cache)

func SwitchNamespace

func SwitchNamespace(kubeconfigPathFromFlag, stateDir string, noIndex bool) error

SwitchNamespace retrieves all available namespaces (either via API call or from local cache) Then sets the selected namespace on the current kubeconfig file (does not create a new tmp. kubeconfig to set namespace)

func SwitchToNamespace

func SwitchToNamespace(targetNamespace, kubeconfigPathFromFlag string) error

SwitchToNamespace takes a target namespace and - given that the namespace exists - sets it on the current kubeconfig file

Types

type NamespaceCache

type NamespaceCache struct {
	// contains filtered or unexported fields
}

func NewNamespaceCache

func NewNamespaceCache(stateDirectory string, contextName string) (*NamespaceCache, error)

NewNamespaceCache creates a new NamespaceCache

func (*NamespaceCache) GetContent

func (i *NamespaceCache) GetContent() []string

func (*NamespaceCache) HasContent

func (i *NamespaceCache) HasContent() bool

func (*NamespaceCache) Write

func (i *NamespaceCache) Write(toWrite []string) error

Jump to

Keyboard shortcuts

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