object

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAnnotation added in v0.1.1

func AddAnnotation(obj metav1.Object, k, v string) bool

AddAnnotation adds an annotation to the object, returns true if the object's annotations are updated.

func AddFinalizer

func AddFinalizer(obj metav1.Object, finalizer string) bool

AddFinalizer adds a finalizer to the object, returns true if the object's finalizers are updated.

func AddLabel added in v0.1.1

func AddLabel(obj metav1.Object, k, v string) bool

AddLabel adds a label to the object, returns true if the object's labels are updated.

func ContainsAnnotation

func ContainsAnnotation(obj metav1.Object, key string) bool

ContainsAnnotation determines whether the object contains an annotation.

func ContainsFinalizer

func ContainsFinalizer(obj metav1.Object, finalizer string) bool

ContainsFinalizer determines whether the object contains a finalizer.

func ContainsLabel

func ContainsLabel(obj metav1.Object, key string) bool

ContainsLabel determines whether the object contains a label.

func GetAnnotation

func GetAnnotation(obj metav1.Object, key string) string

GetAnnotation returns the annotation value of the object.

func GetLabel

func GetLabel(obj metav1.Object, key string) string

GetLabel returns the label value of the object.

func ParseYAMLDocuments added in v0.6.0

func ParseYAMLDocuments(contents []byte) ([][]byte, error)

ParseYAMLDocuments parses YAML documents in a file into separate ones. eg: input:

apiVersion: v1
kind: Namespace
metadata:
	name: test

---
apiVersion: v1
kind: Namespace
metadata:
	name: test2

output:

apiVersion: v1
kind: Namespace
metadata:
	name: test

apiVersion: v1
kind: Namespace
metadata:
	name: test2

func RemoveFinalizer

func RemoveFinalizer(obj metav1.Object, finalizer string) bool

RemoveFinalizer removes the finalizer from the object, returns true if the object's finalizers are updated.

Types

This section is empty.

Jump to

Keyboard shortcuts

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