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

Prevent panic if docker version returns exit code 0 with unexpected output #15851

Merged
merged 2 commits into from
Feb 15, 2023

Conversation

spowelljr
Copy link
Member

There exists a way that docker version --format {{.Server.Os}}-{{.Server.Version}}:{{.Server.Platform.Name}} returns exit code 0 but does not return the expected output, such that it doesn't contain a :. This causes an error as we split on : as assuming that we'd have a length of 2 if docker version returns successfully. But since this assumption is incorrect, we need to prevent a panic.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 14, 2023
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 14, 2023
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.

look good, might look better if possible to add cases to unit test if not thats fine too

pkg/minikube/registry/drvs/docker/docker.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 14, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh, 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

@medyagh
Copy link
Member

medyagh commented Feb 14, 2023

I really like the refactor and simpllfying and huge increase in code readability , thank you ! @spowelljr

@medyagh
Copy link
Member

medyagh commented Feb 15, 2023

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Feb 15, 2023
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 15851) |
+----------------+----------+---------------------+
| minikube start | 53.1s    | 52.6s               |
| enable ingress | 27.0s    | 26.6s               |
+----------------+----------+---------------------+

Times for minikube start: 51.0s 53.8s 55.2s 54.9s 50.7s
Times for minikube (PR 15851) start: 50.2s 50.7s 50.7s 55.4s 56.1s

Times for minikube ingress: 25.6s 29.2s 27.3s 28.2s 24.7s
Times for minikube (PR 15851) ingress: 25.7s 25.2s 28.2s 28.2s 25.7s

docker driver with docker runtime

+-------------------+----------+---------------------+
|      COMMAND      | MINIKUBE | MINIKUBE (PR 15851) |
+-------------------+----------+---------------------+
| minikube start    | 26.8s    | 26.6s               |
| ⚠️  enable ingress | 22.9s    | 33.0s ⚠️             |
+-------------------+----------+---------------------+

Times for minikube start: 27.3s 26.7s 27.4s 26.6s 26.2s
Times for minikube (PR 15851) start: 25.7s 27.6s 26.4s 27.1s 26.1s

Times for minikube (PR 15851) ingress: 22.1s 20.1s 19.1s 21.1s 82.6s
Times for minikube ingress: 22.1s 23.1s 21.1s 22.1s 26.1s

docker driver with containerd runtime

+-------------------+----------+---------------------+
|      COMMAND      | MINIKUBE | MINIKUBE (PR 15851) |
+-------------------+----------+---------------------+
| minikube start    | 22.5s    | 22.1s               |
| ⚠️  enable ingress | 24.6s    | 35.2s ⚠️             |
+-------------------+----------+---------------------+

Times for minikube (PR 15851) start: 21.3s 22.5s 22.5s 21.7s 22.3s
Times for minikube start: 22.8s 22.9s 22.2s 22.3s 22.1s

Times for minikube ingress: 31.6s 31.6s 19.6s 19.6s 20.6s
Times for minikube (PR 15851) ingress: 31.6s 32.6s 47.6s 32.6s 31.6s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Docker_Windows TestRunningBinaryUpgrade (gopogh) 0.00 (chart)
Docker_macOS TestPause/serial/SecondStartNoReconfiguration (gopogh) 3.50 (chart)
Hyper-V_Windows TestPause/serial/SecondStartNoReconfiguration (gopogh) 85.71 (chart)
Hyper-V_Windows TestNoKubernetes/serial/StartWithK8s (gopogh) 91.43 (chart)
Hyper-V_Windows TestRunningBinaryUpgrade (gopogh) 95.71 (chart)
Docker_macOS TestIngressAddonLegacy/serial/ValidateIngressDNSAddonActivation (gopogh) 98.70 (chart)
Docker_macOS TestIngressAddonLegacy/serial/ValidateIngressAddonActivation (gopogh) 100.00 (chart)
Docker_macOS TestIngressAddonLegacy/serial/ValidateIngressAddons (gopogh) 100.00 (chart)
Docker_macOS TestIngressAddonLegacy/StartLegacyK8sCluster (gopogh) 100.00 (chart)
Docker_macOS TestKubernetesUpgrade (gopogh) 100.00 (chart)
Docker_macOS TestMissingContainerUpgrade (gopogh) 100.00 (chart)
Docker_macOS TestRunningBinaryUpgrade (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/AddonExistsAfterStop (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/DeployApp (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/EnableAddonWhileActive (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/FirstStart (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/SecondStart (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/UserAppExistsAfterStop (gopogh) 100.00 (chart)
Docker_macOS TestStoppedBinaryUpgrade/Upgrade (gopogh) 100.00 (chart)
Docker_Windows TestFunctional/parallel/ServiceCmd (gopogh) 100.00 (chart)
Hyper-V_Windows TestMultiNode/serial/PingHostFrom2Pods (gopogh) 100.00 (chart)
Hyper-V_Windows TestMultiNode/serial/RestartKeepsNodes (gopogh) 100.00 (chart)
Hyper-V_Windows TestStoppedBinaryUpgrade/Upgrade (gopogh) 100.00 (chart)
KVM_Linux_containerd TestPreload (gopogh) 100.00 (chart)

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

@medyagh medyagh merged commit 906f30c into kubernetes:master Feb 15, 2023
@spowelljr spowelljr deleted the fixDockerVersionPanic branch March 16, 2023 21:34
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants