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 panic when no services in namespace with --all specified #19957

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

spowelljr
Copy link
Member

@spowelljr spowelljr commented Nov 12, 2024

Fixes: #19933

Before:

$ minikube service --all -n some-namespace-that-doesnt-exists
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
k8s.io/minikube/cmd/minikube/cmd.init.func35(0x10818caa0?, {0x14000984930, 0x0, 0x3?})
	/Users/powellsteven/repo/minikube/cmd/minikube/cmd/service.go:117 +0x1208
github.com/spf13/cobra.(*Command).execute(0x10818caa0, {0x14000984840, 0x3, 0x3})
	/Users/powellsteven/go/pkg/mod/github.com/spf13/[email protected]/command.go:989 +0x81c
github.com/spf13/cobra.(*Command).ExecuteC(0x10818c4e0)
	/Users/powellsteven/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/powellsteven/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
k8s.io/minikube/cmd/minikube/cmd.Execute()
	/Users/powellsteven/repo/minikube/cmd/minikube/cmd/root.go:174 +0x550
main.main()
	/Users/powellsteven/repo/minikube/cmd/minikube/main.go:95 +0x250

After:

$ minikube service --all -n some-namespace-that-doesnt-exists

❌  Exiting due to SVC_NOT_FOUND: No services were found in the 'some-namespace-that-doesnt-exists' namespace.
You may select another namespace by using 'minikube service --all -n <namespace>'

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 12, 2024
@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 Nov 12, 2024
@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

@spowelljr spowelljr merged commit 49eb584 into kubernetes:master Nov 12, 2024
28 of 29 checks passed
@spowelljr spowelljr deleted the fixPanic branch November 12, 2024 18:12
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. 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.

Unhandled exception when tunneling all services with a non-existent namespace
3 participants