-
Notifications
You must be signed in to change notification settings - Fork 431
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
feat(cli): implement platform destroy command #2261
Conversation
✅ Deploy Preview for vcluster-docs canceled.Built without sensitive environment variables
|
fa9d5e1
to
4b4293b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we putting the delete command into the start folder?
That seems a bit counter-intuitive 😅
|
||
startCmd.Flags().StringVar(&cmd.Context, "context", "", "The kube context to use for installation") | ||
startCmd.Flags().StringVar(&cmd.Namespace, "namespace", "", "The namespace vCluster platform is installed in") | ||
startCmd.Flags().BoolVar(&cmd.DeleteNamespace, "delete-namespace", true, "Whether to delete the namespace or not") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to ignore: Might be handy to have something like --ignore-not-found
, which does not error when there's no platfrom.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added this
I'll move it into a destroy folder and move some of the common options out into clihelper |
4b4293b
to
9bf1686
Compare
|
9bf1686
to
d5f6e78
Compare
Ready to review |
} | ||
opts.Log.Infof("deleting customresourcedefinition %v", object.GetName()) | ||
err := apiextensionclientset.ApiextensionsV1().CustomResourceDefinitions().Delete(ctx, object.Name, metav1.DeleteOptions{}) | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err != nil { | |
if err != nil && !kerrors.IsNotFound(err) { |
d5f6e78
to
b58e16e
Compare
Signed-off-by: Rohan CJ <rohantmp@gmail.com>
b58e16e
to
7ca39a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good.
Some nits regarding naming and capitalization.
df29b4d
to
b2b72bc
Compare
Oh wait, there's more capitlization pointed out I missed |
b2b72bc
to
cb78099
Compare
Done, fixed capitalization and "loft" mentions in the touched files |
cb78099
to
ca12d2e
Compare
ca12d2e
to
2b5daa5
Compare
Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2b5daa5
to
81fa5e4
Compare
What issue type does this pull request address? (keep at least one, remove the others)
/kind feature
What does this pull request do? Which issues does it resolve? (use
resolves #<issue_number>
if possible)resolves ENG-3980
Please provide a short message that should be published in the vcluster release notes
Add a new cli command: vcluster platform destroy
What else do we need to know?
The command will wait for each resource type to finish cleaning up before proceeding to the next, so that resource types that depend on each other will not prevent cleanup. (Remove a cluster object before a virtualclusterinstance running on it, etc)
vcluster platform destroy
(no args) on v4.0.0:vcluster platform destroy
(no args) on v3.4.9: