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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Fix clusterctl delete when deleting providers with cluster-wide resources #5420

Merged

Conversation

sbueringer
Copy link
Member

What this PR does / why we need it:
WIP: we can't add new types of the cluster package to the signature as this leads to cyclic dependencies with the fake proxy implementation.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #5417

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 12, 2021
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 12, 2021
@sbueringer
Copy link
Member Author

sbueringer commented Oct 12, 2021

@fabriziopandini PTAL when you've got some time.

If it's valid to add a new func to the interface, I think this would be the cleaner solution and I would extend the fakeProxy accordingly and add new test cases to the Test_providerComponents_Delete test.

If it's not, I only see the option to add magic to the ListResource func. This would work roughly work like that:

  • if labels contains a provider label => exclude resources of CRDs which have the provider label but the value is different

P.S. Also fine for me if we want to implement the second option just to avoid the additional func in the interface.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 13, 2021
@sbueringer sbueringer changed the title [WIP] Fix clusterctl delete Fix clusterctl delete when deleting providers with cluster-wide resources Oct 13, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 13, 2021
@sbueringer sbueringer changed the title Fix clusterctl delete when deleting providers with cluster-wide resources 馃悰 Fix clusterctl delete when deleting providers with cluster-wide resources Oct 13, 2021
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-workload-upgrade-1-22-latest-main
/test pull-cluster-api-e2e-full-main

@fabriziopandini Ready for review.

Adding unit tests would have been too much effort as ListResources creates clients based on a kubeconfig. So I think I would have had to use testenv.

I added a delete in the clusterctl upgrade test to ensure it still works. Once CAPA picks up this change, CAPA also verifies that our issue is fixed (I also tested it manually with the fix as described in the linked issue)

resources

Signed-off-by: Stefan B眉ringer buringerst@vmware.com
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-workload-upgrade-1-22-latest-main
/test pull-cluster-api-e2e-full-main

@fabriziopandini
Copy link
Member

/lgtm
Thanks for adding a E2E test signal on this feature
@ykakarap PTAL

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 13, 2021
@ykakarap
Copy link
Contributor

/lgtm
Thanks for adding a E2E test signal on this feature
@ykakarap PTAL

I will take a look tomorrow :)

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/approve
/hold for @ykakarap

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 19, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vincepri

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 Oct 19, 2021
@ykakarap
Copy link
Contributor

/lgtm

@ykakarap
Copy link
Contributor

@vincepri I reviewed and LGTM's the PR. You can go ahead and cancel the hold.

@vincepri
Copy link
Member

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 19, 2021
@k8s-ci-robot k8s-ci-robot merged commit b3fff36 into kubernetes-sigs:main Oct 19, 2021
@k8s-ci-robot k8s-ci-robot added this to the v0.4 milestone Oct 19, 2021
@sbueringer sbueringer deleted the pr-fix-clusterctl-delete branch October 20, 2021 06:24
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clusterctl delete fails if provider has cluster-wide resources which require conversion
5 participants