k8sutils

package
v1.0.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLabelKeyHostnameLength = errors.New("k8sutils: Invalid label key hostname length")
	ErrInvalidLabelKeyNameLength     = errors.New("k8sutils: Invalid label key name length")
	ErrInvalidLabelValueLength       = errors.New("k8sutils: Invalid label value length")

	TPRPollInterval = 3 * time.Second
	TPRPollTimeout  = 30 * time.Second
)

Functions

func ListPods

func ListPods(pclient clientv1.PodInterface) (*v1.PodList, error)

func LoadClientset

func LoadClientset(cfg *rest.Config) (*kubernetes.Clientset, error)

func LoadInClusterConfig

func LoadInClusterConfig() (*rest.Config, error)

func NewClusterConfig

func NewClusterConfig(kubeconfig string) (*rest.Config, error)

func PodAddOrUpdateAnnotation

func PodAddOrUpdateAnnotation(pod *v1.Pod, key, value string)

func PodAddOrUpdateAnnotations

func PodAddOrUpdateAnnotations(pod *v1.Pod, annotations map[string]string)

func PodAddOrUpdateLabel

func PodAddOrUpdateLabel(pod *v1.Pod, key, value string) error

func PodAddOrUpdateLabels

func PodAddOrUpdateLabels(pod *v1.Pod, labels map[string]string)

func PodDeleteLabel

func PodDeleteLabel(pod *v1.Pod, key string)

func PodDeleteOldLabelsWithPrefix

func PodDeleteOldLabelsWithPrefix(pod *v1.Pod, prefix string, newLabels map[string]string)

Delete the labels with the given prefix whose keys are not in newLabels or if the corresponding values are not equal.

func PodRunningAndReady

func PodRunningAndReady(pod *v1.Pod) (bool, error)

func UpdatePod

func UpdatePod(pclient clientv1.PodInterface, pod *v1.Pod) error

func ValidLabelKey

func ValidLabelKey(key string) (bool, error)

func ValidLabelValue

func ValidLabelValue(value string) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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