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
l.V(1).Info("removed pod template annotations from Deployment to preserve user changes",
190
+
"deployment", unstr.GetName())
191
+
}
192
+
}
193
+
156
194
// sanitizedUnstructured takes an unstructured obj, removes status if present, and returns a sanitized copy containing only the allowed metadata entries set below.
157
195
// If any unallowed entries are removed, a warning will be logged.
196
+
//
197
+
// For Deployment objects, this function removes pod template annotations (but keeps labels).
198
+
// This prevents OLM from overwriting user-added annotations while preserving required labels.
199
+
// Examples: "kubectl rollout restart", "kubectl annotate", or any custom annotations users add.
200
+
// Labels are kept because: (1) deployment selector must match template labels, and
201
+
// (2) chart-provided labels may be referenced by other resources.
202
+
// This fixes the issue where user changes to pod template annotations would be undone by OLM.
0 commit comments