Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

fix: ignore non-targeted clusters during deletion #1499

Merged

Conversation

jonathanbeber
Copy link
Contributor

What this PR does / why we need it:

During the deletion of resources, the controller errors if any cluster
is marked as non-ready. That leads to objects being stuck during
deletion while these clusters are present, even if the resource is not
deployed in such clusters.

This commit makes the reconciliation for deletion to compute the
placement of the federated resources and ignore other clusters. This
way, the deletion will fail just if the non-ready clusters are the
clusters where the object is federated.

Which issue(s) this PR fixes

Fixes #1254

Special notes for your reviewer:

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 17, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @jonathanbeber!

It looks like this is your first PR to kubernetes-sigs/kubefed 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubefed has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 17, 2022
@k8s-ci-robot k8s-ci-robot requested review from font and makkes March 17, 2022 22:08
Copy link
Contributor

@makkes makkes left a comment

Choose a reason for hiding this comment

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

Thanks @jonathanbeber for taking point on this. The changes look good to me but I'd like to see some tests added to the PR. Most of the tests are defined in test/e2e so you might want to add tests pertaining to this new behaviour there.

@makkes
Copy link
Contributor

makkes commented Mar 22, 2022

@jimmidyson @hectorj2f would you mind approving the workflow runs on this PR, please?

@hectorj2f
Copy link
Contributor

Approved and ran

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 25, 2022
@jonathanbeber jonathanbeber force-pushed the fix-deletion-non-ready branch 3 times, most recently from 45c7567 to 74e0510 Compare March 25, 2022 22:28
@jonathanbeber
Copy link
Contributor Author

can someone please approve the CI once again?

@jonathanbeber
Copy link
Contributor Author

CI ran and it seems ok, could some please review/approve?

@jonathanbeber
Copy link
Contributor Author

Any review is appreciated

Copy link
Contributor

@makkes makkes left a comment

Choose a reason for hiding this comment

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

just a nit, otherwise lgtm

test/e2e/not_ready.go Outdated Show resolved Hide resolved
@jonathanbeber
Copy link
Contributor Author

thank you @makkes!

Copy link
Contributor

@makkes makkes left a comment

Choose a reason for hiding this comment

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

Nice work! 👏🏻

@makkes
Copy link
Contributor

makkes commented Apr 27, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 27, 2022
@makkes
Copy link
Contributor

makkes commented Apr 27, 2022

/assign @irfanurrehman

@irfanurrehman
Copy link
Contributor

@jonathanbeber please check the CI failures.

During the deletion of resources, the controller errors if any cluster
is marked as non-ready. That leads to objects being stuck during
deletion while these clusters are present, even if the resource is not
deployed in such clusters.

This commit makes the reconciliation for deletion to compute the
placement of the federated resources and ignore other clusters. This
way, the deletion will fail just if the non-ready clusters are the
clusters where the object is federated.
The e2e tests do not consider any unhealthy cluster. This commit adds a
test case where the cluster federates itself twice and makes one the
virtual federation not-ready by changing the API endpoint to an invalid
address. The ready cluster is labelled and a complete CRUD test
guarantees that the not-ready cluster does not impact operations if the
the cluster is not targeted.
@jonathanbeber
Copy link
Contributor Author

That's really strange, the last commit just changes the year in the initial comment of a file. Checking further

@jonathanbeber jonathanbeber force-pushed the fix-deletion-non-ready branch from 9dc3772 to d19b80c Compare May 5, 2022 15:32
@k8s-ci-robot k8s-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label May 5, 2022
@jonathanbeber
Copy link
Contributor Author

@irfanurrehman could you please approve the CI run again?

@jonathanbeber
Copy link
Contributor Author

It seems good to merge now @irfanurrehman

@irfanurrehman
Copy link
Contributor

It seems good to merge now @irfanurrehman

Thanks for doing this @jonathanbeber

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 6, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: irfanurrehman, jonathanbeber, makkes

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 6, 2022
@k8s-ci-robot k8s-ci-robot merged commit 9ec6713 into kubernetes-retired:master May 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The deletion of federated resources will be blocked forever by not-ready clusters
5 participants