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

Fix network retry check for subnet already in use for podman #17779

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

thomasjm
Copy link
Contributor

The code in the tryCreateDockerNetwork function (which is also used for Podman) tries to detect when network creation fails because the requested subnet is already in use, so that the caller can retry. It does this by checking for certain strings in the output of the podman/docker network create command. In the case of Podman, it fails to detect this correctly because the string Podman uses was not included.

(This manifested as the inability to create two Minikube clusters simultaneously on the same machine, because the second one would fail with an error about network creation.)

To see this, here's the error message when I use my machine's rootless podman (version 4.5.0) and try to create the same subnet twice:

λ podman network create --subnet 192.168.49.0/24
podman1
λ podman network create --subnet 192.168.49.0/24
Error: subnet 192.168.49.0/24 is already used on the host or by another config

This PR just adds an additional string to check in tryCreateDockerNetwork.

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

Welcome @thomasjm!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @thomasjm. 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 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 Dec 13, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: thomasjm
Once this PR has been reviewed and has the lgtm label, please assign spowelljr for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 12, 2024
@thomasjm
Copy link
Contributor Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 12, 2024
@@ -156,6 +156,9 @@ func tryCreateDockerNetwork(ociBin string, subnet *network.Parameters, mtu int,
if strings.Contains(rr.Output(), "is being used by a network interface") {
return nil, ErrNetworkGatewayTaken
}
if strings.Contains(rr.Output(), "is already used on the host or by another config") {
Copy link

Choose a reason for hiding this comment

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

WYT of changing from is already used on the host to is already in use on the host?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Huh? This needs to match the output of Podman, it's not up to us to change.

@medyagh
Copy link
Member

medyagh commented Jun 12, 2024

/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 Jun 12, 2024
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 17779) |
+----------------+----------+---------------------+
| minikube start | 48.3s    | 47.2s               |
| enable ingress | 24.3s    | 25.3s               |
+----------------+----------+---------------------+

Times for minikube start: 48.4s 45.2s 45.7s 52.7s 49.7s
Times for minikube (PR 17779) start: 47.4s 46.3s 45.6s 47.3s 49.1s

Times for minikube ingress: 23.4s 23.9s 24.5s 23.9s 25.5s
Times for minikube (PR 17779) ingress: 23.9s 23.9s 27.9s 26.9s 24.0s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 17779) |
+----------------+----------+---------------------+
| minikube start | 23.7s    | 22.2s               |
| enable ingress | 22.4s    | 21.6s               |
+----------------+----------+---------------------+

Times for minikube start: 24.7s 24.4s 23.9s 21.7s 23.7s
Times for minikube (PR 17779) start: 23.5s 23.6s 21.2s 21.5s 21.3s

Times for minikube ingress: 21.2s 25.3s 21.3s 22.3s 21.8s
Times for minikube (PR 17779) ingress: 21.8s 21.8s 21.8s 21.8s 20.8s

docker driver with containerd runtime

+-------------------+----------+---------------------+
|      COMMAND      | MINIKUBE | MINIKUBE (PR 17779) |
+-------------------+----------+---------------------+
| minikube start    | 20.4s    | 21.0s               |
| ⚠️  enable ingress | 32.1s    | 38.6s ⚠️             |
+-------------------+----------+---------------------+

Times for minikube start: 22.2s 19.9s 20.0s 20.4s 19.8s
Times for minikube (PR 17779) start: 24.2s 20.2s 20.7s 20.6s 19.5s

Times for minikube ingress: 32.2s 32.3s 31.8s 31.7s 32.3s
Times for minikube (PR 17779) ingress: 47.7s 31.7s 47.8s 33.3s 32.3s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
KVM_Linux_crio TestFunctional/parallel/ImageCommands/ImageRemove (gopogh) 2.01 (chart)
Docker_Linux_containerd TestAddons/parallel/CSI (gopogh) 4.03 (chart)
Docker_Windows TestStartStop/group/old-k8s-version/serial/SecondStart (gopogh) 38.46 (chart)

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

@medyagh
Copy link
Member

medyagh commented Jun 17, 2024

/ok-to-test

@medyagh
Copy link
Member

medyagh commented Jun 17, 2024

@thomasjm thank you for improving the experience for the podman users !

btw our functional tests for podman has been failing for while (on github actions) I would love to see an extra eyes on that if you are interested, thank you for your contributions

@medyagh medyagh merged commit f1adfd6 into kubernetes:master Jun 17, 2024
11 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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/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.

7 participants