annotations

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(obj runtime.Object, annotation string) string

Get get the annotation value of the provided k8s object for the specified annotation key. Return empty string if the object is not runtime.Object.

func GetAll

func GetAll(obj runtime.Object) map[string]string

GetAll get all annotations of the provided k8s object. Return nil if the provided object is not runtime.Object.

func Has

func Has(obj runtime.Object, annotation string) bool

Has will return true if the k8s object has specified annotation, otherwise return false. Label key and value separated by "=".

If the provided annotation only contains annotation key, then only to check whether the annotations of the k8s object contains the annotation key. If the provided annotation contains annotation key and value, then check whether the annotations of the k8s object contains the annotation key and value.

func Remove

func Remove(obj runtime.Object, annotation ...string) error

Remove will delete the provided annotation for the k8s object if contains it.

func RemoveAll

func RemoveAll(obj runtime.Object) error

RemoveAll will remove all annotations of the k8s object.

func Set

func Set(obj runtime.Object, annotation ...string) error

Set set annotations for the provided k8s object. Label key and value separated by "=". If annotation already exist, it will update the annotation. If annotation not exist, it will add the annotation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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