chore: preserve legacy config-manager during controller upgrade#10081
chore: preserve legacy config-manager during controller upgrade#10081
Conversation
|
Auto Cherry-pick Instructions |
d498c04 to
485f1c4
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10081 +/- ##
==========================================
+ Coverage 51.51% 51.69% +0.18%
==========================================
Files 525 525
Lines 58146 58393 +247
==========================================
+ Hits 29955 30189 +234
- Misses 25232 25261 +29
+ Partials 2959 2943 -16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/approve |
485f1c4 to
3463395
Compare
3463395 to
e0e7f84
Compare
e0e7f84 to
77228e1
Compare
| // Clean up only when the configured policy will recreate Pods. Otherwise we keep the live template aligned | ||
| // with old Pods that still carry the legacy sidecar and avoid creating an extra rollout only for cleanup. | ||
| if hasPodUpgradeTemplateChanges(oldTemplate, newTemplate) { | ||
| return desiredITS.Spec.PodUpgradePolicy == appsv1.ReCreatePodUpdatePolicyType |
There was a problem hiding this comment.
What about PreferInPlace policy? If ITS controller decides to recreate pod, then we should also clean up config manager.
There was a problem hiding this comment.
Yes. PreferInPlace is only a preference, not a guarantee.
The cleanup logic has been updated to follow whether this rollout would actually recreate Pods, rather than matching the policy name literally. So if ITS still ends up recreating Pods under PreferInPlace, legacy config-manager will be cleaned up in the same rollout; otherwise it will be preserved.
| if comp == nil || comp.Annotations == nil { | ||
| return legacyConfigManagerPolicyKeep | ||
| } | ||
| value, ok := comp.Annotations[constant.LegacyConfigManagerRequiredAnnotationKey] |
There was a problem hiding this comment.
This annotaion will be set by user?
There was a problem hiding this comment.
It is not intended to be user-managed. It is written by the parameters controller on the Cluster and then inherited by the Component as an internal compatibility marker.
No description provided.