Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Skip Kubernetes preloads and binary downloads when --no-kubernetes is... #21107 #21139

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

Open
divysinghvi wants to merge 17 commits into kubernetes:master
base: master
Choose a base branch
Loading
from divysinghvi:no-kubernetes-skip-downloads

Conversation

Copy link
Contributor

@divysinghvi divysinghvi commented Jul 25, 2025

This PR improves the Binary function in binary.go to better handle Kubernetes binary downloads. It adds logic to skip downloads when the --no-kubernetes flag is set, ensures not downloading unnecessary downloads with version v0.0.0
Before
Screenshot 2025年07月25日 at 1 05 43 PM
After
Screenshot 2025年07月25日 at 1 08 30 PM
This pr Fixes the issue #21107

Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: divysinghvi
Once this PR has been reviewed and has the lgtm label, please assign prezha for approval. For more information see the 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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 25, 2025
@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 Jul 25, 2025
Copy link
Contributor

Hi @divysinghvi. 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 the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 25, 2025
Copy link
Collaborator

Can one of the admins verify this patch?

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.

thank you @divysinghvi please consider adding an integraiton test sub-test to

https://vscode.dev/github/kubernetes/minikube/blob/separate-hack/test/integration/no_kubernetes_test.go#L32

before {"StartNoK8sWithVersion", validateStartNoK8sWithVersion}, you can do --download-only and check using -minikube ssh -- ls path/to/binary/- that the file doesnt exist

Copy link
Contributor Author

@medyagh Thanks for the suggestion! Just to clarify, for the integration test you mentioned, which exact Kubernetes binary path should I check for in the VM after running minikube with --no-kubernetes --download-only?
but i am confused what exact binary path should i check for

Copy link
Member

medyagh commented Jul 28, 2025

Lets also try not setting k8s version to 0.0.0 and see what breaks and why did we have to that

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.

lets add a sub test that that checks this folder should not exist
~/.minikube/cache/linux/amd64/v0.0.0/

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 10, 2025
Copy link
Member

medyagh commented Aug 10, 2025

ok-to-test

defer PostMortemLogs(t, profile)

// Start minikube with --no-kubernetes flag
args := append([]string{"start", "-p", profile, "--no-kubernetes", "--memory=2048"}, StartArgs()...)
Copy link
Member

Choose a reason for hiding this comment

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

no need to start another minikube, use the Existing started minikube and simply add a sub test
like this
{"StartNoK8sWithVersion", validateStartNoK8sWithVersion},
---> {"VerifyNok8sNoK8sDownloads", },

		{"StartWithK8s", validateStartWithK8S},
		{"StartWithStopK8s", validateStartWithStopK8s},

Copy link
Contributor Author

@divysinghvi divysinghvi Aug 10, 2025

Choose a reason for hiding this comment

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

since in StartNoK8sWithVersion we pass a Kubernetes version with --no-kubernetes isn't that suppose to exits with an error and that won't leave a running cluster to reuse i guess.

Copy link
Contributor Author

@divysinghvi divysinghvi Aug 10, 2025

Choose a reason for hiding this comment

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

maybe we are reuse this instance {"Start", validateStartNoK8S}, since it will be fresh working instance

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 11, 2025
Copy link
Member

medyagh commented Sep 8, 2025

/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 Sep 8, 2025
...KubernetesT
est now pass locally also fixed the error from fatel to Errorf

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor Author

/retest

This comment has been minimized.

This comment has been minimized.

defer PostMortemLogs(t, profile)

// Clean any existing cache from previous tests to ensure we test only --no-kubernetes behavior
cachePath := filepath.Join(localpath.MiniPath(), "cache", "linux", runtime.GOARCH, "v0.0.0")
Copy link
Member

Choose a reason for hiding this comment

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

question is why Other tests generated any folder with "v0.0.0" ?
how about instead of this, When it fails we can list the minikube home and check why it is there in first place.

Before minikube test starts, we purge and have we have separte minikube home for the test

Copy link
Contributor Author

@divysinghvi divysinghvi Sep 26, 2025

Choose a reason for hiding this comment

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

that would be way better approach i had some issue with it so i was experimenting with thing i will look more into it thanks , yes the other tests should also not generate the folder with "v0.0.0" i was just experimenting with things if that fixes it and also one more issue i am facing is the tests are passing on my system since my last 3 commit
WhatsApp Image 2025年09月26日 at 14 58 12

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor Author

/retest

Copy link
Contributor Author

/retest-required

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor Author

/retest

This comment has been minimized.

This comment has been minimized.

func VerifyNoK8sDownloadCache(ctx context.Context, t *testing.T, profile string) {
defer PostMortemLogs(t, profile)

cachePath := filepath.Join(localpath.MiniPath(), "cache", "linux", runtime.GOARCH, "v0.0.0")
Copy link
Member

@medyagh medyagh Oct 6, 2025

Choose a reason for hiding this comment

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

this should not be tested only on linux !
the reason it is passing on your machine it is beecause it checks to see if linux doesnt exist

you can use goos to get os

Copy link
Contributor Author

@divysinghvi divysinghvi Oct 9, 2025

Choose a reason for hiding this comment

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

Thanks medhya i have now used GOOS to get current os, and yes it passes on my system now also
=== RUN TestNoKubernetes/serial/VerifyNok8sNoK8sDownloads no_kubernetes_test.go:91: Checking cache directory: /Users/divysinghvi/.minikube/cache/darwin/arm64/v0.0.0 no_kubernetes_test.go:104: No cache directory found (as expected)
also found a function in binary.go TransferBinaries this maybe creating directories so testing it now

Copy link
Contributor

@divysinghvi: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-minikube-integration acfd8b7 link true /test pull-minikube-integration

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

Copy link

kvm2 driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│ COMMAND │ MINIKUBE │ MINIKUBE ( PR 21139 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 45.7s │ 43.7s │
│ enable ingress │ 15.9s │ 15.8s │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 44.1s 47.8s 44.2s 47.6s 44.8s
Times for minikube (PR 21139) start: 41.3s 43.7s 45.1s 45.3s 43.3s

Times for minikube (PR 21139) ingress: 15.8s 15.8s 15.8s 15.8s 15.8s
Times for minikube ingress: 15.8s 15.9s 16.3s 15.3s 16.3s

docker driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│ COMMAND │ MINIKUBE │ MINIKUBE ( PR 21139 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 22.1s │ 23.0s │
│ enable ingress │ 12.4s │ 12.4s │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 20.9s 21.1s 22.2s 25.4s 21.1s
Times for minikube (PR 21139) start: 21.8s 23.9s 24.1s 23.4s 21.6s

Times for minikube ingress: 13.6s 12.6s 11.6s 12.6s 11.6s
Times for minikube (PR 21139) ingress: 10.6s 13.6s 12.6s 10.6s 14.6s

docker driver with containerd runtime

┌────────────────┬──────────┬────────────────────────┐
│ COMMAND │ MINIKUBE │ MINIKUBE ( PR 21139 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 21.1s │ 21.1s │
│ enable ingress │ 20.7s │ 20.3s │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 20.2s 19.1s 22.2s 24.0s 20.0s
Times for minikube (PR 21139) start: 19.1s 21.3s 22.4s 20.4s 22.4s

Times for minikube ingress: 20.1s 21.1s 21.2s 21.1s 20.1s
Times for minikube (PR 21139) ingress: 21.1s 20.1s 20.1s 20.1s 20.1s

Copy link
Contributor Author

@medyagh i tired putting a lot of checks but was not able to identify what is causing the directory to get created but we are able to step the files being created, directory thing i am not able to verify what is causing that you also told me to check localpath.go but i was not able to identify specific for our purpose , now we have either one option we go with the only file approach and have directory check but the test fails only when we have the files in those or figure out a way for finding directory thing in linux

Copy link

Here are the number of top 10 failed tests in each environments with lowest flake rate.

Environment Test Name Flake Rate
Docker_Linux (1 failed) TestNoKubernetes/serial/VerifyNok8sNoK8sDownloads(gopogh) Unknown
Docker_Linux_containerd_arm64 (1 failed) TestNoKubernetes/serial/VerifyNok8sNoK8sDownloads(gopogh) Unknown
Docker_Linux_containerd (1 failed) TestNoKubernetes/serial/VerifyNok8sNoK8sDownloads(gopogh) Unknown
KVM_Linux (1 failed) TestNoKubernetes/serial/VerifyNok8sNoK8sDownloads(gopogh) Unknown
Docker_Linux_docker_arm64 (1 failed) TestNoKubernetes/serial/VerifyNok8sNoK8sDownloads(gopogh) Unknown
KVM_Linux_containerd (1 failed) TestNoKubernetes/serial/VerifyNok8sNoK8sDownloads(gopogh) Unknown
KVM_Linux_crio (5 failed) TestNoKubernetes/serial/VerifyNok8sNoK8sDownloads(gopogh) Unknown
KVM_Linux_crio (5 failed) TestFunctional/parallel/ImageCommands/ImageRemove(gopogh) 2.50% (chart)

Besides the following environments also have failed tests:

  • Docker_Linux_crio: 56 failed (gopogh)

  • Docker_Linux_crio_arm64: 39 failed (gopogh)

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

Copy link
Member

medyagh commented Oct 15, 2025

it is interesting on my mac and personal linux it does not create v0.0.0 folder but in CI machines it does ! this is a mystrie !

Copy link
Contributor Author

yes @medyagh i have tried everything i could find like i am still not able to figure how folder is getting created in the ci testing it is so weird , since now even you have verified it is not creating the v 0.0.0 when are testing it locally how should be proceed it next? easiest approach would be to check for files within the folder and let it pass when the directory is empty or anything other in mind ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@medyagh medyagh medyagh requested changes

@ComradeProgrammer ComradeProgrammer Awaiting requested review from ComradeProgrammer

Assignees

No one assigned

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/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /