Skip to content

Commit 5b2080f

Browse files
committed
Fix url index out of range error in service
* if there is no node port, service panics accessing url * since the length of array is 3 when there is no node port, accessing u[3] results in index out of range
1 parent 4f20418 commit 5b2080f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/minikube/cmd/service.go

+6
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,12 @@ func mutateURLs(serviceName string, urls []string) ([]string, error) {
260260

261261
func openURLs(urls [][]string) {
262262
for _, u := range urls {
263+
264+
if len(u) < 4{
265+
klog.Warning("No URL found")
266+
continue
267+
}
268+
263269
_, err := url.Parse(u[3])
264270
if err != nil {
265271
klog.Warningf("failed to parse url %q: %v (will not open)", u[3], err)

0 commit comments

Comments
 (0)