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

kvm2 driver: Don't delete the "default" libvirt network #18920

Merged
merged 1 commit into from
May 22, 2024

Conversation

nirs
Copy link
Contributor

@nirs nirs commented May 18, 2024

The special "default" network is created by libvirt and owned by the system admin, but we try to delete it when deleting a profile.

To reproduce the issue, start and delete minikube on a system without any other vm using the libvirt default network:

minikube start --driver kvm2 --network default
minikube delete

The default network will be delete, and the next minikube start will fail, complaining about missing libvirt default networking and linking to the complicated instructions how to recreate it.

Now we skip deletion of the special "default" network.

Example run log:

$ out/minikube delete -v10 --logtostderr 2>delete.log
* Deleting "minikube" in kvm2 ...
* Removed all traces of the "minikube" cluster.

$ cat delete.log
...
I0518 03:41:27.148838 1247331 out.go:177] * Deleting "minikube" in kvm2 ...
I0518 03:41:27.148857 1247331 main.go:141] libmachine: (minikube) Calling .Remove
I0518 03:41:27.149156 1247331 main.go:141] libmachine: (minikube) DBG | Removing machine...
I0518 03:41:27.159000 1247331 main.go:141] libmachine: (minikube) DBG | Trying to delete the networks (if possible)
I0518 03:41:27.169497 1247331 main.go:141] libmachine: (minikube) DBG | Using the default network, skipping deletion
I0518 03:41:27.169598 1247331 main.go:141] libmachine: (minikube) Successfully deleted networks
...

Fixes #18919

The special "default" network is created by libvirt and owned by the
system admin, but we try to delete it when deleting a profile.

To reproduce the issue, start and delete minikube on a system without
any other vm using the libvirt default network:

    minikube start --driver kvm2 --network default
    minikube delete

The default network will be delete, and the next minikube start will
fail, complaining about missing libvirt default networking and linking
to the complicated instructions how to recreate it.

Now we skip deletion of the special "default" network.

Example run log:

    $ out/minikube delete -v10 --logtostderr 2>delete.log
    * Deleting "minikube" in kvm2 ...
    * Removed all traces of the "minikube" cluster.

    $ cat delete.log
    ...
    I0518 03:41:27.148838 1247331 out.go:177] * Deleting "minikube" in kvm2 ...
    I0518 03:41:27.148857 1247331 main.go:141] libmachine: (minikube) Calling .Remove
    I0518 03:41:27.149156 1247331 main.go:141] libmachine: (minikube) DBG | Removing machine...
    I0518 03:41:27.159000 1247331 main.go:141] libmachine: (minikube) DBG | Trying to delete the networks (if possible)
    I0518 03:41:27.169497 1247331 main.go:141] libmachine: (minikube) DBG | Using the default network, skipping deletion
    I0518 03:41:27.169598 1247331 main.go:141] libmachine: (minikube) Successfully deleted networks
    ...
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 18, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @nirs. 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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 18, 2024
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@spowelljr
Copy link
Member

/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 May 20, 2024
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 20, 2024
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 18920) |
+----------------+----------+---------------------+
| minikube start | 50.1s    | 50.0s               |
| enable ingress | 24.7s    | 26.2s               |
+----------------+----------+---------------------+

Times for minikube ingress: 23.9s 23.0s 26.9s 24.0s 25.4s
Times for minikube (PR 18920) ingress: 27.9s 27.0s 27.0s 24.4s 24.5s

Times for minikube start: 49.7s 50.8s 48.9s 51.4s 49.5s
Times for minikube (PR 18920) start: 50.3s 52.3s 47.9s 50.6s 48.8s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 18920) |
+----------------+----------+---------------------+
| minikube start | 22.3s    | 22.5s               |
| enable ingress | 21.8s    | 21.7s               |
+----------------+----------+---------------------+

Times for minikube ingress: 21.7s 21.7s 21.8s 22.7s 21.2s
Times for minikube (PR 18920) ingress: 21.8s 21.8s 21.7s 21.8s 21.3s

Times for minikube start: 20.5s 23.3s 20.5s 23.6s 23.8s
Times for minikube (PR 18920) start: 24.2s 20.7s 22.5s 23.9s 21.0s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 18920) |
+----------------+----------+---------------------+
| minikube start | 22.3s    | 20.6s               |
| enable ingress | 32.0s    | 35.2s               |
+----------------+----------+---------------------+

Times for minikube start: 20.4s 22.7s 22.5s 23.1s 22.8s
Times for minikube (PR 18920) start: 22.1s 19.9s 20.1s 20.3s 20.6s

Times for minikube ingress: 31.2s 32.2s 32.2s 32.8s 31.3s
Times for minikube (PR 18920) ingress: 32.3s 48.2s 31.8s 32.8s 30.8s

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

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

@afbjorklund @josedonizetti wdyt think about this PR ?

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Docker_Linux_crio TestFunctional/parallel/MountCmd/specific-port (gopogh) 0.00 (chart)
Docker_Linux TestFunctional/parallel/ConfigCmd (gopogh) 0.00 (chart)
Hyperkit_macOS TestMountStart/serial/StartWithMountSecond (gopogh) 0.00 (chart)
Hyperkit_macOS TestSkaffold (gopogh) 29.17 (chart)
Hyperkit_macOS TestKubernetesUpgrade (gopogh) 34.78 (chart)
Hyperkit_macOS TestMultiNode/serial/RestartKeepsNodes (gopogh) 36.17 (chart)
Hyperkit_macOS TestMultiNode/serial/StopMultiNode (gopogh) 36.17 (chart)
Hyperkit_macOS TestMultiNode/serial/DeleteNode (gopogh) 38.30 (chart)
Hyperkit_macOS TestMultiNode/serial/RestartMultiNode (gopogh) 48.94 (chart)

To see the flake rates of all tests by environment, click here.

@medyagh
Copy link
Member

medyagh commented May 22, 2024

/lgtm

@medyagh medyagh merged commit fcd907f into kubernetes:master May 22, 2024
34 of 53 checks passed
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 22, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh, nirs, spowelljr

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

@nirs nirs deleted the keep-default-network branch May 22, 2024 18:45
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minikube tries to delete the default libvirt network
6 participants