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

Function HasAnnotations

tests/utils/clusterutils/cluster.go:111–123  ·  view source on GitHub ↗

HasAnnotations verifies that the annotations of a cluster contain a specified annotations map

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

Source from the content-addressed store, hash-verified

109// HasAnnotations verifies that the annotations of a cluster contain a specified
110// annotations map
111func HasAnnotations(
112 cluster *apiv1.Cluster,
113 annotations map[string]string,
114) bool {
115 clusterAnnotations := cluster.Annotations
116 for k, v := range annotations {
117 val, ok := clusterAnnotations[k]
118 if !ok || (v != val) {
119 return false
120 }
121 }
122 return true
123}
124
125// Get gets a cluster given name and namespace
126func Get(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected