-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Implement kubectl rollout undo and history for DaemonSet #46144
Implement kubectl rollout undo and history for DaemonSet #46144
Conversation
43e6b50
to
8c3c57d
Compare
8c3c57d
to
662ed9c
Compare
b143207
to
3654c13
Compare
@k8s-bot pull-kubernetes-e2e-gce-etcd3 test this |
91ded34
to
6e4a4f6
Compare
In controller code, annotations of a DS is copied to its history (upon history creation time). Does it make sense to copy annotations from a history to a DS when rolling back? Note that a history is reused if its template matches, which means we won't have two snapshots of a DS with the same template, even if their annotations are different. Edit: history's labels shouldn't be copied from DS labels, but from template labels (so that it'll be selected by the DS selector) |
6e4a4f6
to
9df14ea
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: janetkuo, mengqiy, smarterclayton The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@k8s-bot pull-kubernetes-e2e-gce-etcd3 test this |
return nil | ||
} | ||
ds.Spec.Template = *toTemplate | ||
_, err = r.c.Extensions().DaemonSets(ds.Namespace).Update(ds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this Update be made conditional on the resource version being the same as before, in case there is a race between Get and Update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlikely, so no need to fix in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the resource version isn't the same, Update
will fail (return conflict error)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optimistic locking which is used by Update(PUT) should take care of that.
@k8s-bot pull-kubernetes-e2e-kops-aws test this |
Automatic merge from submit-queue Implement Daemonset history ~Depends on #45867 (the 1st commit, ignore it when reviewing)~ (already merged) Ref kubernetes/community#527 and kubernetes/community#594 @kubernetes/sig-apps-api-reviews @kubernetes/sig-apps-pr-reviews @erictune @kow3ns @lukaszo @Kargakis --- TODOs: - [x] API changes - [x] (maybe) Remove rollback subresource if we decide to do client-side rollback - [x] deployment controller - [x] controller revision - [x] owner ref (claim & adoption) - [x] history reconstruct (put revision number, hash collision avoidance) - [x] de-dup history and relabel pods - [x] compare ds template with history - [x] hash labels (put it in controller revision, pods, and maybe deployment) - [x] clean up old history - [x] Rename status.uniquifier when we reach consensus in #44774 - [x] e2e tests - [x] unit tests - [x] daemoncontroller_test.go - [x] update_test.go - [x] ~(maybe) storage_test.go // if we do server side rollback~ kubectl part is in #46144 --- **Release note**: ```release-note ```
fe09f11
to
edabdac
Compare
Rebased |
/retest |
@k8s-bot pull-kubernetes-federation-e2e-gce test this Unrelated federation build failure |
@k8s-bot pull-kubernetes-federation-e2e-gce test this |
1 similar comment
@k8s-bot pull-kubernetes-federation-e2e-gce test this |
All recent pull-kubernetes-federation-e2e-gce across PRs failed: https://k8s-gubernator.appspot.com/builds/kubernetes-jenkins/pr-logs/directory/pull-kubernetes-federation-e2e-gce 🤷♀️ |
@janetkuo: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Automatic merge from submit-queue (batch tested with PRs 45871, 46498, 46729, 46144, 46804) |
Depends on #45924, only the 2nd commit needs review(merged)Ref kubernetes/community#527
TODOs:
(do we need to?) print labels and annotations(do we need to?) replace the ds labels and annotations with history's@kubernetes/sig-apps-pr-reviews @erictune @kow3ns @lukaszo @Kargakis @kubernetes/sig-cli-maintainers
Release note: