-
Notifications
You must be signed in to change notification settings - Fork 66
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
WINC-612: [wmco] Handle deletion of windows-instances #527
WINC-612: [wmco] Handle deletion of windows-instances #527
Conversation
/approve cancel |
/cherry-pick release-4.8 |
@aravindhp: once the present PR merges, I will cherry-pick it on top of release-4.8 in a new PR and assign it to you. In response to this:
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. |
/cherry-pick community-4.8 |
@aravindhp: once the present PR merges, I will cherry-pick it on top of community-4.8 in a new PR and assign it to you. In response to this:
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. |
controllers/configmap_controller.go
Outdated
// If DeleteStateUnknown is true it implies that the Delete event was missed and we can ignore it | ||
if e.DeleteStateUnknown { | ||
return false | ||
} |
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.
In this case why should we skip the reconciliation? We should still ensure that everything is as expected should we not?
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.
I went with the documented example. Not sure if we should be reacting to objects that have not been fully deleted.
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 we are definitely going to get a second event when the object is fully deleted that makes sense to me
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.
So should I remove this check or leave it in?
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.
I was thinking that it would be fine to leave the check, but having looked at the controller-runtime code I am not so sure.
It being true does not mean that it hasnt been fully deleted, but that the event was missed.
// DeleteStateUnknown is true if the Delete event was missed but we identified the object
// as having been deleted.
Digging more into how the delete event is actually generated:
- How we create a controller: https://github.com/kubernetes-sigs/controller-runtime/blob/865d56a824cc295f4895aca40af48737e188bd0c/alias.go#L101
- When we call
.Watches(...)
on a controller we declare that we want to watch for events for a specific object: https://github.com/kubernetes-sigs/controller-runtime/blob/865d56a824cc295f4895aca40af48737e188bd0c/pkg/source/source.go#L88 - The internal.EventHandler is always used: https://github.com/kubernetes-sigs/controller-runtime/blob/865d56a824cc295f4895aca40af48737e188bd0c/pkg/source/source.go#L133
- Delete events are handled and DeleteStateUnknown set: https://github.com/kubernetes-sigs/controller-runtime/blob/865d56a824cc295f4895aca40af48737e188bd0c/pkg/source/internal/eventsource.go#L101-L105
// Deal with tombstone events by pulling the object out. Tombstone events wrap the object in a
// DeleteFinalStateUnknown struct, so the object needs to be pulled out.
// Copied from sample-controller
// This should never happen if we aren't missing events, which we have concluded that we are not
// and made decisions off of this belief. Maybe this shouldn't be here?
- And finally the DeleteFinalStateUnknown definition: https://github.com/kubernetes/client-go/blob/e337077829155da74648d511bfa560a148fd965d/tools/cache/delta_fifo.go#L740-L743
// DeletedFinalStateUnknown is placed into a DeltaFIFO in the case where an object
// was deleted but the watch deletion event was missed while disconnected from
// apiserver. In this case we don't know the final "resting" state of the object, so
// there's a chance the included `Obj` is stale.
What I'm getting from this is that the issue with handling these events is the given object might be stale. That shouldn't be an issue, as we retrieve the current state of the object when handling the event. It does not look like we will get another delete event after this one. I think its safer to not filter these out.
The docs seem to be misleading. Are you getting the same conclusion as me from the code?
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.
@sebsoto I have removed the check. PTAL.
/retitle WINC-612: [wmco] Handle deletion of windows-instances |
If the admin deletes the "windows-instances" ConfigMap, the operation is viewed as a call to deconfigure all BYOH Windows instances. This commits handles that scenario.
600ccd1
to
6f7f03a
Compare
/hold |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sebsoto The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
/lgtm |
/retest |
/hold cancel |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
@aravindhp: new pull request created: #531 In response to this:
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. |
@aravindhp: new pull request created: #532 In response to this:
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. |
If the admin deletes the
windows-instances
ConfigMap, the operation is viewed as a call to deconfigure all BYOH Windows instances. This PR handles that scenario.