utils

package
v1.0.0-alpha.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAnnotation

func AddAnnotation(obj Annotated, annotationKey string, annotationValue string)

func AddHashAnnotation

func AddHashAnnotation(obj Annotated, annotationKey string)

func AddLabel

func AddLabel(obj Labeled, labelKey string, labelValue string)

func CompareAnnotations

func CompareAnnotations(r1, r2 Annotated, annotationKey string) bool

func CreatedByK8ssandraControllerLabels

func CreatedByK8ssandraControllerLabels(klusterKey client.ObjectKey) map[string]string

CreatedByK8ssandraControllerLabels returns the labels used to identify a component created by the k8ssandra-cluster controller, and belonging to the K8ssandraCluster resource specified by klusterKey, which is namespace and name of the K8ssandraCluster.

func DeepHashString

func DeepHashString(obj interface{}) string

func GetAnnotation

func GetAnnotation(component Annotated, annotationKey string) string

func GetLabel

func GetLabel(component Labeled, labelKey string) string

func HasAnnotationWithValue

func HasAnnotationWithValue(component Annotated, annotationKey string, annotationValue string) bool

func HasLabelWithValue

func HasLabelWithValue(component Labeled, labelKey string, labelValue string) bool

func IsCreatedByK8ssandraController

func IsCreatedByK8ssandraController(component Labeled, klusterKey client.ObjectKey) bool

IsCreatedByK8ssandraController returns true if this component was created by the k8ssandra-cluster controller, and belongs to the K8ssandraCluster resource specified by klusterKey. klusterKey referns to the namespace and name of the K8ssandraCluster.

func IsManagedBy

func IsManagedBy(component Labeled, klusterKey client.ObjectKey) bool

IsManagedBy checks whether the given component is managed by K8ssandra, and belongs to the K8ssandraCluster resource specified by klusterKey which specifies the namespace and name of the K8ssandraCluster.

func ManagedByLabels

func ManagedByLabels(klusterKey client.ObjectKey) map[string]string

ManagedByLabels returns the labels used to identify a component managed by K8ssandra. klusterKey specifies the namespace and name of the K8ssandraCluster.

func MergeMap

func MergeMap(sources ...map[string]string) map[string]string

MergeMap will take two or more maps, merging the entries of the sources map into a destination map. If both maps share the same key then destination's value for that key will be overwritten with what's in source.

func SetManagedBy

func SetManagedBy(component Labeled, klusterKey client.ObjectKey)

SetManagedBy sets the required labels for making a component managed by K8ssandra. klusterKey specifies the namespace and name of the K8ssandraCluster.

func SliceContains

func SliceContains(slice []string, s string) bool

Types

type Annotated

type Annotated interface {
	GetAnnotations() map[string]string
	SetAnnotations(annotations map[string]string)
}

type Labeled

type Labeled interface {
	GetLabels() map[string]string
	SetLabels(labels map[string]string)
}

Jump to

Keyboard shortcuts

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