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

Function annotationsFrom

pkg/servicespec/reconcile_test.go:39–46  ·  view source on GitHub ↗

annotationsFrom builds an annotations map with lastAppliedSpec from a ServiceSpec. Pass nil to simulate no last-applied annotation.

(spec *corev1.ServiceSpec)

Source from the content-addressed store, hash-verified

37// annotationsFrom builds an annotations map with lastAppliedSpec from a ServiceSpec.
38// Pass nil to simulate no last-applied annotation.
39func annotationsFrom(spec *corev1.ServiceSpec) map[string]string {
40 if spec == nil {
41 return nil
42 }
43 meta := metav1.ObjectMeta{}
44 SetLastApplied(&meta, spec)
45 return meta.Annotations
46}
47
48// fullyPopulatedServiceSpec returns a ServiceSpec with every field set to a
49// non-zero value. This is used by reflection-based tests to verify that

Callers 1

reconcile_test.goFile · 0.85

Calls 1

SetLastAppliedFunction · 0.85

Tested by

no test coverage detected