Custom labels and/or annotations are not applied to existing Pods and PVCs
Summary
When new custom labels and/or annotations are added to an existing SGCluster (via .spec.metadata.labels / .spec.metadata.annotations), they are
propagated to the StatefulSet pod template but are not applied to the already existing Pods and PVCs. Existing resources only receive the new
labels/annotations after they are recreated (e.g. a pod restart), instead of being patched in place during reconciliation.
Expected behavior
Adding new labels/annotations to an existing cluster should result in those labels/annotations being applied to the existing Pods and PVCs without requiring them to be recreated.
Steps to reproduce
- Create an
SGClusterand wait for its Pods and PVCs to be ready. - Add a new label and a new annotation to
.spec.metadata.labels.clusterPods/.spec.metadata.annotations.clusterPods. - Observe that the existing Pods and PVCs do not get the newly added label/annotation.
Notes
- e2e coverage is added in the
custom-labelsandcustom-annotationsspecs to assert that newly added labels/annotations reach the existing Pods and PVCs.