MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / HasLabels

Function HasLabels

tests/utils/clusterutils/cluster.go:95–107  ·  view source on GitHub ↗

HasLabels verifies that the labels of a cluster contain a specified labels map

(
	cluster *apiv1.Cluster,
	labels map[string]string,
)

Source from the content-addressed store, hash-verified

93// HasLabels verifies that the labels of a cluster contain a specified
94// labels map
95func HasLabels(
96 cluster *apiv1.Cluster,
97 labels map[string]string,
98) bool {
99 clusterLabels := cluster.Labels
100 for k, v := range labels {
101 val, ok := clusterLabels[k]
102 if !ok || (v != val) {
103 return false
104 }
105 }
106 return true
107}
108
109// HasAnnotations verifies that the annotations of a cluster contain a specified
110// annotations map

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected