You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Preserve user changes to deployment pod templates
Fixes OLM reverting user changes like kubectl rollout restart.
OLM no longer stores pod template metadata, allowing user changes o annotations, labels, and other fields to persist.
Generate-by: Cursor/Claude
// sanitizedUnstructured takes an unstructured obj, removes status if present, and returns a sanitized copy containing only the allowed metadata entries set below.
157
202
// If any unallowed entries are removed, a warning will be logged.
203
+
//
204
+
// For Deployment objects, this function conditionally removes empty pod template annotations.
205
+
// Bundle-provided annotations are preserved to maintain operator functionality.
206
+
// Empty annotations are removed to allow users to add custom annotations without OLM reverting them.
207
+
// Examples of user annotations: "kubectl rollout restart", "kubectl annotate", custom monitoring annotations.
208
+
// Labels are kept because: (1) deployment selector must match template labels, and
209
+
// (2) chart-provided labels may be referenced by other resources.
210
+
// This fixes the issue where user changes to pod template annotations would be undone by OLM.
0 commit comments