annotationsFrom builds an annotations map with lastAppliedSpec from a ServiceSpec. Pass nil to simulate no last-applied annotation.
(spec *corev1.ServiceSpec)
| 37 | // annotationsFrom builds an annotations map with lastAppliedSpec from a ServiceSpec. |
| 38 | // Pass nil to simulate no last-applied annotation. |
| 39 | func 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 |
no test coverage detected