Skip to content
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

Conversation

aravindhp
Copy link
Contributor

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.

@openshift-ci openshift-ci bot requested a review from sebsoto July 19, 2021 19:28
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 19, 2021
@aravindhp
Copy link
Contributor Author

/approve cancel
/cc @openshift/openshift-team-windows-containers

@openshift-ci openshift-ci bot requested a review from a team July 19, 2021 19:35
@openshift-ci openshift-ci bot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 19, 2021
@aravindhp
Copy link
Contributor Author

/cherry-pick release-4.8

@openshift-cherrypick-robot

@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:

/cherry-pick release-4.8

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
Copy link
Contributor Author

/cherry-pick community-4.8

@openshift-cherrypick-robot

@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:

/cherry-pick community-4.8

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.

Comment on lines 283 to 286
// If DeleteStateUnknown is true it implies that the Delete event was missed and we can ignore it
if e.DeleteStateUnknown {
return false
}
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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:

	// 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?
// 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?

Copy link
Contributor Author

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.

@aravindhp
Copy link
Contributor Author

aravindhp commented Jul 20, 2021

/retitle WINC-612: [wmco] Handle deletion of windows-instances

@openshift-ci openshift-ci bot changed the title [wmco] Handle deletion of windows-instances WINC-612: [wmco] Handle deletion of windows-instances Jul 20, 2021
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.
@aravindhp aravindhp force-pushed the winc-612-instance-singleton-3 branch from 600ccd1 to 6f7f03a Compare July 21, 2021 19:36
@aravindhp
Copy link
Contributor Author

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 21, 2021
@sebsoto
Copy link
Contributor

sebsoto commented Jul 21, 2021

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 21, 2021

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 21, 2021
@alinaryan
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 21, 2021
@mansikulkarni96
Copy link
Member

/lgtm

@aravindhp
Copy link
Contributor Author

/retest

@aravindhp
Copy link
Contributor Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 22, 2021
@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@aravindhp
Copy link
Contributor Author

/retest

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-cherrypick-robot

@aravindhp: new pull request created: #531

In response to this:

/cherry-pick release-4.8

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.

@openshift-cherrypick-robot

@aravindhp: new pull request created: #532

In response to this:

/cherry-pick community-4.8

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants