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

🌱 Allows delelting multiple providers at once #3617

Merged

Conversation

gab-satchi
Copy link
Member

What this PR does / why we need it:
Clusterctl delete currently would break out of loop after finding one provider to delete and only delete that provider. The cli has grown to provide flags for core, bootstrap and controlplane providers along with infrastructure. With these changes, any combination of those providers can be deleted.

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 #3558

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 9, 2020
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 9, 2020
Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

@gab-satchi question
Looking at the implementation I see we are fixing the issue of clusterctl deleting one provider for each run, but I can't see this part of the issue being addressed:

Perhaps it would be convenient to do something like clusterctl delete --all --namespace foobaz to delete all the providers within the specified namespace.

If we are not going to address this, might be we should prevent--all and --namespace to be used together. WDYT?

@gab-satchi
Copy link
Member Author

I missed the all case. clusterctl delete --all --namespace foobaz to delete all the providers within the specified namespace makes sense to me. I'll update with the changes

/hold

@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 Sep 10, 2020
@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 Sep 10, 2020
@gab-satchi
Copy link
Member Author

/unhold

@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 Sep 10, 2020
@gab-satchi
Copy link
Member Author

failing due to known flakes.

/test pull-cluster-api-test

Copy link

@benmoss benmoss left a comment

Choose a reason for hiding this comment

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

some nits but otherwise lgtm

cmd/clusterctl/cmd/delete.go Outdated Show resolved Hide resolved
@@ -68,6 +68,18 @@ var deleteCmd = &cobra.Command{
# Cluster API Providers are orphaned and there might be ongoing costs incurred as a result of this.
clusterctl delete --all

# Deletes all the providers in a namespace
# Important! As a consequence of this operation, all the corresponding resources managed by
Copy link

Choose a reason for hiding this comment

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

This goes beyond this PR but I think we might be diluting the importance of "Important!" by saying it 6 times 😄

@gab-satchi
Copy link
Member Author

/test pull-cluster-api-make

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

/approve

cmd/clusterctl/client/delete.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 11, 2020
- allows for deleting all providers in a specific namespace
Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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

@fabriziopandini
Copy link
Member

/assign @wfernandes
for a final pass

@wfernandes
Copy link
Contributor

Reviewing
/assign

Copy link
Contributor

@wfernandes wfernandes left a comment

Choose a reason for hiding this comment

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

I ran it locally and it seems to work as expected including the --all flag.
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 14, 2020
@k8s-ci-robot k8s-ci-robot merged commit cd8ac05 into kubernetes-sigs:master Sep 14, 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. 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/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.

clusterctl unable to delete multiple providers from a namespace
5 participants