k8s

package
v0.0.0-...-5544660 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ResourceNameLengthLimit stores maximum allowed Length for a ResourceName
	ResourceNameLengthLimit = 63
)

Variables

This section is empty.

Functions

func AddAnnotation

func AddAnnotation(obj metav1.Object, annotation string, value string)

AddAnnotation creates or updates an annotation on an object meta. The Annotations map is initialized if nil

func Base64

func Base64(src string, length int) string

Base64 returns the n first characters of a base64 encoding of src. It returns the full base64 if length equals 0

func ContainersToMap

func ContainersToMap(containers []corev1.Container) map[string]corev1.Container

ContainersToMap maps an array of containers indexed by the container name

func GetAnnotation

func GetAnnotation(obj metav1.Object, annotation string) (string, bool)

GetAnnotation safely returns an annotation value if it exists

func HasAnnotation

func HasAnnotation(obj metav1.Object, annotation string) bool

HasAnnotation safely checks if an annotation exists

func RemoveAnnotation

func RemoveAnnotation(obj metav1.Object, annotation string)

RemoveAnnotation removes an annotation on an object meta

func SetContainer

func SetContainer(containers []corev1.Container, container *corev1.Container)

SetContainer replace a container in an array by finding it by its name

func ToDNSName

func ToDNSName(prefix string, name string, suffix string) string

ToDNSName create a valid DNS name using a prefix, name and suffix. The name is based64 hashed if necessary

Types

This section is empty.

Jump to

Keyboard shortcuts

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