k8s

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextManager

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

ContextManager context manager implementing ContextOps

func (*ContextManager) CheckConfig

func (k *ContextManager) CheckConfig() error

CheckConfig checks if the kubeConfig pointed to by configAccess exists

func (*ContextManager) CopyContext

func (k *ContextManager) CopyContext(srcConfigAccess clientcmd.ConfigAccess, srcCtxName, targetCtxName, targetNamespace string) error

CopyContext copies context srcCtxName part of srcConfigAccess to targetCtxName part of targetConfigAccess.

func (*ContextManager) RemoveContext

func (k *ContextManager) RemoveContext(ctxName string) error

RemoveKubeContext removes the contextToRemove from the kubeContext pointed to be fromConfigAccess

type ContextOps

type ContextOps interface {
	CheckConfig() error
	CopyContext(srcConfigAccess clientcmd.ConfigAccess, srcCtxName, targetCtxName, targetNamespace string) error
	RemoveContext(ctxName string) error
}
var ContextMgr ContextOps

func NewK8sContextManager

func NewK8sContextManager() ContextOps

type K8s

type K8s interface {
	CoreV1() corev1.CoreV1Interface
}
var Client K8s

func GetK8sClient

func GetK8sClient(cfg, master string) (K8s, error)

GetK8sClient return the k8s client from sandbox kubeconfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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