This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Description
Description
The Harbor Operator currently propagates all labels from HarborCluster to the StatefulSets it manages. This behavior can lead to issues when these labels conflict with the immutable selectors of the StatefulSet, causing update failures.
The underlying Redis Operator, used by Harbor Operator, provides a label whitelisting feature via spec.LabelWhitelist in the API to control which labels are propagated to the StatefulSet. However, the Harbor Operator is not currently utilizing this feature.
What would you like to be added
Modify the Harbor Operator to leverage the Redis Operator's spec.LabelWhitelist feature to help filter out labels being propagated from resources to StatefulSet selectors.
Why is this needed
-
StatefulSet Immutability: Kubernetes enforces the immutability of StatefulSet selectors, i.e. they can’t be updated
-
Update Failures: Attempting to update a StatefulSet with extra selector labels results in errors, hindering management operations.
-
Flexibility: Decoupling template labels and selectors provides greater flexibility in managing StatefulSets. It will allow us to get clear distinction between labels used for resource identification and those applied for organizational purposes.
References
Kubernetes Issue: kubernetes/kubernetes#90519 (Discusses the immutability of StatefulSet selectors)