-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Delete subnode's machine directories #9955
Conversation
Hi @daehyeok. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Can one of the admins verify this patch? |
b4dd974
to
f87b34d
Compare
/ok-to-test |
kvm2 Driver |
kvm2 Driver |
@@ -496,6 +497,15 @@ func deleteProfileDirectory(profile string) { | |||
} |
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.
thanks for finding out this ! we were not cleaning up the machine folder for multi node
I wonder if there are other places that we are missing this
for example
in func demolish
is there a chance we could add this delete Machine directory to wherever it is doing for the single node ?
my undrestanding is, for single node delete the machine folder correctly but for multinode we are not.
is there any other place in the code we could do this ? (as opposed to a deffered clean up?)
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.
Even for the single node, it looks DeleteHost
not remove directory.
It's handled by deleteProfileDirectory
minikube/cmd/minikube/cmd/delete.go
Lines 330 to 331 in f680057
// In case DeleteHost didn't complete the job. | |
deleteProfileDirectory(profile.Name) |
❯ minikube start -p test-profile
😄 [test-profile] minikube v1.16.0 on Darwin 10.15.7
✨ Automatically selected the docker driver
👍 Starting control plane node test-profile in cluster test-profile
🔥 Creating docker container (CPUs=2, Memory=1988MB) ...
🐳 Preparing Kubernetes v1.20.0 on Docker 20.10.0 ...
▪ Generating certificates and keys ...
▪ Booting up control plane ...
▪ Configuring RBAC rules ...
🔎 Verifying Kubernetes components...
🌟 Enabled addons: storage-provisioner, default-storageclass
🏄 Done! kubectl is now configured to use "test-profile" cluster and "default" namespace by default
❯ minikube delete -p test-profile
🔥 Deleting "test-profile" in docker ...
🔥 Deleting container "test-profile" ...
🔥 Removing /Users/daehyeok/.minikube/machines/test-profile ...
💀 Removed all traces of the "test-profile" cluster.
🔥 Removing /Users/daehyeok/.minikube/machines/test-profile ...
this line printed by deleteProfileDirectory
minikube/cmd/minikube/cmd/delete.go
Lines 488 to 491 in f680057
func deleteProfileDirectory(profile string) { | |
machineDir := filepath.Join(localpath.MiniPath(), "machines", profile) | |
if _, err := os.Stat(machineDir); err == nil { | |
out.Step(style.DeletingHost, `Removing {{.directory}} ...`, out.V{"directory": machineDir}) |
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.
maybe we should fix delete
function ?
https://github.com/medyagh/minikube/blob/75cd17801287339a00efe44fbd451b4dbfadef86/pkg/minikube/machine/delete.go#L104
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.
that is a good idea ! @daehyeok .
admitably our delete code is the messiest and worst part of minikube code (huge huge huge chance for BIG refactor)
once we had an idea to break down the delete code in the CMD package into package.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: daehyeok, medyagh 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 |
f87b34d
to
b11190c
Compare
fixes #9954
Update delete command to remove all subnode's machine directories.