-
Story
-
Resolution: Unresolved
-
Major
-
None
-
None
-
Product / Portfolio Work
-
False
-
-
False
-
3
-
None
-
None
-
OCPEDGE Sprint 283
-
1
Title: Implement StorageClass reconciliation logic for StorageClassOptions
Description: Update the StorageClass controller to apply StorageClassOptions and handle day-2 updates using a delete+recreate pattern (required because Kubernetes StorageClass spec fields are immutable).
Acceptance Criteria:
- EnsureCreated method updated in topolvm_storageclass.go with:
- Check if StorageClass exists
- Compare immutable fields (reclaimPolicy, volumeBindingMode, parameters)
- Delete+recreate if immutable fields changed
- Update only metadata (labels) if only labels changed
- needsRecreation helper method added to detect spec changes
- applyAdditionalLabels helper method added to merge labels safely
- getTopolvmStorageClasses method updated to:
- Apply StorageClassOptions with defaults
- Skip conflicting additionalParameters with warning logs
- Apply additionalLabels to generated StorageClasses
- Proper logging added for recreation events
- Import reflect package for DeepEqual comparisons
- Import corev1 for PersistentVolumeReclaimPolicy
Technical Notes:
-
- Delete+recreate is required because K8s StorageClass spec is immutable
- Existing PVCs are unaffected by SC recreation (they store provisioning info at creation)
- Brief window (<1s) where new PVC creation may fail during recreation
- LVMS-managed labels cannot be overridden: app.kubernetes.io/* prefix labels