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

Delete subnode's machine directories #9955

Merged
merged 1 commit into from
Dec 31, 2020

Conversation

daehyeok
Copy link
Contributor

fixes #9954

Update delete command to remove all subnode's machine directories.

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

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 14, 2020
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 14, 2020
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@tstromberg
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 16, 2020
@minikube-pr-bot
Copy link

kvm2 Driver
error collecting results for kvm2 driver: timing run 0 with Minikube (PR 9955): timing cmd: [/home/performance-monitor/.minikube/minikube-binaries/9955/minikube start --driver=kvm2]: starting cmd: fork/exec /home/performance-monitor/.minikube/minikube-binaries/9955/minikube: exec format error
docker Driver
error collecting results for docker driver: timing run 0 with minikube: timing cmd: [/home/performance-monitor/minikube/out/minikube start --driver=docker]: waiting for minikube: exit status 50

@minikube-pr-bot
Copy link

kvm2 Driver
error collecting results for kvm2 driver: timing run 0 with minikube: timing cmd: [./minikube start --driver=kvm2]: waiting for minikube: exit status 81
docker Driver
error collecting results for docker driver: timing run 0 with minikube: timing cmd: [./minikube start --driver=docker]: waiting for minikube: exit status 80

@@ -496,6 +497,15 @@ func deleteProfileDirectory(profile string) {
}
Copy link
Member

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

https://github.com/medyagh/minikube/blob/75cd17801287339a00efe44fbd451b4dbfadef86/pkg/minikube/machine/delete.go#L122

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?)

Copy link
Contributor Author

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

// 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

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})

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

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.

@k8s-ci-robot
Copy link
Contributor

[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 /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 Dec 23, 2020
@medyagh medyagh merged commit 6d763a1 into kubernetes:master Dec 31, 2020
@daehyeok daehyeok deleted the delete_machine_dirs branch January 9, 2021 20:39
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

minikube delete doesn't remove subnodes machine directory
6 participants