-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[release-1.20] Preserve deployment and its template labels and annotations #16303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[release-1.20] Preserve deployment and its template labels and annotations #16303
Conversation
When running `kubectl rollout restart deployment`, Kubernetes adds the `kubectl.kubernetes.io/restartedAt` annotation to the deployment's pod template to trigger a rolling restart. However, Knative's reconciler was removing this annotation by completely replacing the deployment spec, causing new pods to be immediately terminated instead of completing the rollout. This change preserves externally-added metadata at both the deployment level and template level during reconciliation by filtering Knative-controlled keys (*.knative.dev and app label) from the current state before merging with the desired state. This ensures Knative maintains full control over its own metadata while preserving external additions.
|
As requested by a user in #16199 (comment) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-1.20 #16303 +/- ##
================================================
- Coverage 80.05% 80.02% -0.04%
================================================
Files 214 214
Lines 13281 13289 +8
================================================
+ Hits 10632 10634 +2
- Misses 2291 2297 +6
Partials 358 358 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/hold I'm holding a bunch of PRs for 1.20 release - waiting to get confirmation of a metric fix |
|
/hold cancel |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dprotaso, knative-prow-robot The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This is an automated cherry-pick of #16199