Skip to content

Remove broken node start --delete-on-failure flag - #23382

Open
sammaji wants to merge 1 commit into
kubernetes:masterfrom
sammaji:master
Open

Remove broken node start --delete-on-failure flag#23382
sammaji wants to merge 1 commit into
kubernetes:masterfrom
sammaji:master

Conversation

@sammaji

@sammaji sammaji commented Jul 18, 2026

Copy link
Copy Markdown

Viper has a single global flag namespace, but cobra registers flags per-command. A local flag only becomes visible to viper.Get*() if it is explicitly bound with viper.BindPFlags() for the command being run. Only root, start, and delete do this binding, so any other command reading a local flag via viper.Get*() is silently broken.

Two commands were affected:

  • minikube cache add --all — the flag was registered on addCacheCmd but never bound to viper, so it was always read as false and images were only cached to the current profile, never to all running profiles.
  • minikube node start --delete-on-failure — same issue: viper.GetBool(deleteOnFailure) always returned false, so a failed node start was never deleted and retried.

BindPFlags can't simply be added for these commands because flag names collide across commands (e.g. --all is also used by cache delete and stop), and since every command's init() runs at startup, binding one command's flags to the global viper namespace would clobber bindings for other commands using the same name.

Fix

  • minikube node start --delete-on-failure never worked and nobody has reported relying on it, so the flag is removed rather than wired up. minikube start --delete-on-failure is unaffected. (minikube cache is kept as it is).

Docs were regenerated (make generate-docs) to drop the removed command and flag.

Fixes #23347

Copilot AI review requested due to automatic review settings July 18, 2026 21:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

Details 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

@kubernetes-prow kubernetes-prow Bot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 18, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Welcome @sammaji!

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. 😃

@kubernetes-prow kubernetes-prow Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 18, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Hi @sammaji. 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.

Details

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.

@sammaji sammaji changed the title Remove deprecated cache command and broken node start --delete-on-failure flag [WIP] Remove deprecated cache command and broken node start --delete-on-failure flag Jul 18, 2026
@kubernetes-prow kubernetes-prow Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 18, 2026
@minikube-bot

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@nirs

nirs commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

@sammaji This is too much - we need do separate PRs for these changes. Removing the cache command is a big change and we need to discuss it first.

We can remove now the --delete-on-failure flag - small and simple change, and never works so basically no change in behavior.

@kubernetes-prow kubernetes-prow Bot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Jul 19, 2026
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 19, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: sammaji / name: Samyabrata Maji (60f5aaf)

@kubernetes-prow kubernetes-prow Bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 19, 2026
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 19, 2026
@sammaji sammaji changed the title [WIP] Remove deprecated cache command and broken node start --delete-on-failure flag Remove broken node start --delete-on-failure flag Jul 19, 2026
@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 19, 2026
@sammaji

sammaji commented Jul 19, 2026

Copy link
Copy Markdown
Author

@nirs I have scoped the changes to --delete-on-failure only.

@sammaji

sammaji commented Jul 19, 2026

Copy link
Copy Markdown
Author

This is too much - we need do separate PRs for these changes. Removing the cache command is a big change and we need to discuss it first.

@nirs agreed, I will create a PR around it, we can remove this deprecated command with a major release.

@nirs

nirs commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Two commands were affected:

  • minikube cache add --all — the flag was registered on addCacheCmd but never bound to viper, so it was always read as false and images were only cached to the current profile, never to all running profiles.

This is not relevant to this PR.

Did you reproduce the issue? Please show example runs before and after this fix.

I'm not sure this will be easy to show - likely require looking in minikube log and may require adding new log to inspect the value.

@nirs nirs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Change looks good - but we need to verify the bug report first to make sure the assumptions are correct.

The issue was based on code inspection for this command, and validated for the cache add command, which has the same issue in --all flag.

@nirs

nirs commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

/ok-to-test

@kubernetes-prow kubernetes-prow Bot 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 Jul 19, 2026
```
--delete-on-failure If set, delete the current cluster if start fails and try again. Defaults to false.
```

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think that this is auto-generated so we don't need to include it in the PR. When the PR is merged, an update workflow will create a pr like this #23303 will handle the docs change.

@kubernetes-prow

Copy link
Copy Markdown
Contributor

@sammaji: The following tests 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-docker-crio-linux-x86 60f5aaf link false /test pull-minikube-docker-crio-linux-x86
pull-minikube-kvm-containerd-linux-x86 60f5aaf link true /test pull-minikube-kvm-containerd-linux-x86

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.

Details

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.

@minikube-pr-bot

Copy link
Copy Markdown

kvm2 driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 23382 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 36.1s    │ 35.9s                  │
│ enable ingress │ 15.7s    │ 15.3s                  │
└────────────────┴──────────┴────────────────────────┘
Details

Times for minikube (PR 23382) start: 36.2s 35.9s 35.8s 35.4s 36.2s
Times for minikube start: 37.1s 35.6s 35.9s 35.9s 36.1s

Times for minikube ingress: 14.7s 15.2s 18.7s 15.2s 14.7s
Times for minikube (PR 23382) ingress: 15.2s 15.7s 15.2s 15.2s 15.2s

docker driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 23382 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 19.2s    │ 19.9s                  │
│ enable ingress │ 12.9s    │ 11.4s                  │
└────────────────┴──────────┴────────────────────────┘
Details

Times for minikube start: 18.0s 18.4s 19.4s 20.9s 19.1s
Times for minikube (PR 23382) start: 18.0s 21.4s 20.8s 20.9s 18.6s

Times for minikube ingress: 18.6s 10.6s 12.6s 10.1s 12.6s
Times for minikube (PR 23382) ingress: 12.6s 10.6s 10.6s 10.6s 12.7s

docker driver with containerd runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 23382 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 17.8s    │ 18.0s                  │
│ enable ingress │ 25.1s    │ 24.8s                  │
└────────────────┴──────────┴────────────────────────┘
Details

Times for minikube (PR 23382) start: 19.5s 20.1s 17.5s 17.1s 15.7s
Times for minikube start: 16.4s 19.3s 17.2s 19.7s 16.2s

Times for minikube ingress: 25.2s 24.7s 25.2s 25.2s 25.2s
Times for minikube (PR 23382) ingress: 24.7s 24.7s 25.2s 24.7s 25.1s

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/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 cache add --all and minikube node start --delete-on-failure flags silently ignored

5 participants