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

Make uninstall safer and faster #951

Merged
merged 1 commit into from
Dec 1, 2020
Merged

Make uninstall safer and faster #951

merged 1 commit into from
Dec 1, 2020

Conversation

tiraboschi
Copy link
Member

@tiraboschi tiraboschi commented Nov 19, 2020

Make uninstall safer and faster

kubectl/oc delete command by defaults runs with --wait=true and so it waits for resources to be gone before returning.
This waits for finalizers.

The client-go from controller-runtime instead doesn't implement that logic that it's completely up to the caller.

Let's implement it in ComponentResourceRemoval to be sure that the deletion is safe.
Use a context with 30 second timeouts to avoid getting stuck forever in the middle of the delete.

Let's then try to delete other CRs in parallel with goroutines syncked with a wait group to make the uninstall faster.

Introduce a graceful period of 60 seconds after all the operators removed the finalizer on their CRs and before removing HCO one as a workaround for bugs on component operators.

Signed-off-by: Simone Tiraboschi stirabos@redhat.com

Release note:

Make uninstall safer and faster

@tiraboschi tiraboschi added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Nov 19, 2020
@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Nov 19, 2020
@hco-bot
Copy link
Collaborator

hco-bot commented Nov 19, 2020

hco-e2e-image-index-aws lane succeeded.
/override ci/prow/hco-e2e-image-index-gcp

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-gcp

In response to this:

hco-e2e-image-index-aws lane succeeded.
/override ci/prow/hco-e2e-image-index-gcp

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.

@nunnatsa
Copy link
Collaborator

/approve
/lgtm

@kubevirt-bot kubevirt-bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed lgtm Indicates that a PR is ready to be merged. labels Nov 19, 2020
@hco-bot
Copy link
Collaborator

hco-bot commented Nov 23, 2020

hco-e2e-image-index-aws lane succeeded.
/override ci/prow/hco-e2e-image-index-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-azure

In response to this:

hco-e2e-image-index-aws lane succeeded.
/override ci/prow/hco-e2e-image-index-azure

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.

@kubevirt-bot kubevirt-bot added size/M release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed size/XS labels Nov 23, 2020
@tiraboschi tiraboschi changed the title WIP: Delete other CRs with DeletePropagationForeground Delete other CRs with DeletePropagationForeground Nov 23, 2020
@kubevirt-bot kubevirt-bot removed release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Nov 23, 2020
@hco-bot
Copy link
Collaborator

hco-bot commented Nov 23, 2020

hco-e2e-aws lane succeeded.
/override ci/prow/hco-e2e-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-azure

In response to this:

hco-e2e-aws lane succeeded.
/override ci/prow/hco-e2e-azure

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Nov 23, 2020

hco-e2e-image-index-gcp lane succeeded.
/override ci/prow/hco-e2e-image-index-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-aws

In response to this:

hco-e2e-image-index-gcp lane succeeded.
/override ci/prow/hco-e2e-image-index-aws

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.

@tiraboschi tiraboschi changed the title Delete other CRs with DeletePropagationForeground Make uninstall safer and faster Nov 26, 2020
@hco-bot
Copy link
Collaborator

hco-bot commented Nov 27, 2020

hco-e2e-azure lane succeeded.
/override ci/prow/hco-e2e-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-aws

In response to this:

hco-e2e-azure lane succeeded.
/override ci/prow/hco-e2e-aws

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Nov 27, 2020

hco-e2e-aws lane succeeded.
/override ci/prow/hco-e2e-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-azure

In response to this:

hco-e2e-aws lane succeeded.
/override ci/prow/hco-e2e-azure

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Nov 27, 2020

hco-e2e-image-index-azure, hco-e2e-image-index-gcp lanes succeeded.
/override ci/prow/hco-e2e-image-index-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-aws

In response to this:

hco-e2e-image-index-azure, hco-e2e-image-index-gcp lanes succeeded.
/override ci/prow/hco-e2e-image-index-aws

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Nov 27, 2020

hco-e2e-image-index-gcp lane succeeded.
/override ci/prow/hco-e2e-image-index-aws
hco-e2e-aws lane succeeded.
/override ci/prow/hco-e2e-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-azure, ci/prow/hco-e2e-image-index-aws

In response to this:

hco-e2e-image-index-gcp lane succeeded.
/override ci/prow/hco-e2e-image-index-aws
hco-e2e-aws lane succeeded.
/override ci/prow/hco-e2e-azure

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Nov 27, 2020

hco-e2e-aws lane succeeded.
/override ci/prow/hco-e2e-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-azure

In response to this:

hco-e2e-aws lane succeeded.
/override ci/prow/hco-e2e-azure

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Nov 28, 2020

hco-e2e-image-index-azure, hco-e2e-image-index-gcp lanes succeeded.
/override ci/prow/hco-e2e-image-index-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-aws

In response to this:

hco-e2e-image-index-azure, hco-e2e-image-index-gcp lanes succeeded.
/override ci/prow/hco-e2e-image-index-aws

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Nov 30, 2020

hco-e2e-azure lane succeeded.
/override ci/prow/hco-e2e-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-aws

In response to this:

hco-e2e-azure lane succeeded.
/override ci/prow/hco-e2e-aws

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Nov 30, 2020

hco-e2e-image-index-gcp lane succeeded.
/override ci/prow/hco-e2e-image-index-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-aws

In response to this:

hco-e2e-image-index-gcp lane succeeded.
/override ci/prow/hco-e2e-image-index-aws

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Nov 30, 2020

hco-e2e-azure lane succeeded.
/override ci/prow/hco-e2e-aws
hco-e2e-upgrade-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-aws, ci/prow/hco-e2e-upgrade-aws

In response to this:

hco-e2e-azure lane succeeded.
/override ci/prow/hco-e2e-aws
hco-e2e-upgrade-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-aws

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.

@tiraboschi
Copy link
Member Author

Ignoring slightly decreased coverage:
/override coverage/coveralls

@kubevirt-bot
Copy link
Contributor

@tiraboschi: Overrode contexts on behalf of tiraboschi: coverage/coveralls

In response to this:

Ignoring slightly decreased coverage:
/override coverage/coveralls

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.

@tiraboschi
Copy link
Member Author

/unhold

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 1, 2020
kubectl/oc delete command by defaults
runs with --wait=true
and so it waits for resources to be gone
before returning.
This waits for finalizers.

The client-go from controller-runtime
instead doesn't implement that logic
that it's completely up to the caller.

Let's implement it in ComponentResourceRemoval
to be sure that the deletion is safe.
Use a context with 30 second timeouts to
avoid getting stuck forever in the middle of the delete.

Let's then try to delete other CRs
in parallel with goroutines
syncked with a wait group to make
the uninstall faster.

Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
@tiraboschi
Copy link
Member Author

Ignoring slightly decreased coverage:
/override coverage/coveralls

@kubevirt-bot
Copy link
Contributor

@tiraboschi: Overrode contexts on behalf of tiraboschi: coverage/coveralls

In response to this:

Ignoring slightly decreased coverage:
/override coverage/coveralls

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.

Copy link
Collaborator

@nunnatsa nunnatsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 1, 2020
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nunnatsa

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

@kubevirt-bot kubevirt-bot merged commit 0530eb5 into kubevirt:master Dec 1, 2020
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants