config

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NctlExtensionContext = "nctl"
)

Variables

View Source
var (
	// ErrExtensionNotFound describes a missing extension in the kubeconfig
	ErrExtensionNotFound extensionError = "nctl config not found"
)

Functions

func ContextName

func ContextName(cluster *infrastructure.KubernetesCluster) string

ContextName returns the kubeconfig context name for the given cluster

func IsExtensionNotFoundError

func IsExtensionNotFoundError(err error) bool

IsExtensionNotFoundError returns true if the nctl config could not be found in the kubconfig context

func RemoveClusterFromKubeConfig

func RemoveClusterFromKubeConfig(kubeconfigPath, clusterContext string) error

RemoveClusterFromKubeConfig removes the given context from the kubeconfig

func SetContextOrganization

func SetContextOrganization(kubeconfigPath string, contextName string, organization string) error

SetContextOrganization sets the given organization in the given context of the kubeconfig

func SetContextProject

func SetContextProject(kubeconfigPath string, contextName string, project string) error

SetContextProject sets the given project in the given context of the kubeconfig

Types

type Extension

type Extension struct {
	metav1.TypeMeta `json:",inline"`
	Organization    string `json:"organization"`
}

Extension is used to store custom information in the kubeconfig context created

func NewExtension

func NewExtension(organization string) *Extension

func ReadExtension

func ReadExtension(kubeconfigPath string, contextName string) (*Extension, error)

func (*Extension) ToObject

func (e *Extension) ToObject() (runtime.Object, error)

ToObject wraps a Config in a runtime.Unknown object which implements runtime.Object.

Jump to

Keyboard shortcuts

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