Skip to content

Commit 945b436

Browse files
authored
don't call startKicServiceTunnel for non-kic drivers (#20863)
* don't call startKicServiceTunnel for non-kic drivers * warn about exposing ClusterIP services for all drivers
1 parent 4bca65a commit 945b436

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

cmd/minikube/cmd/service.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,20 @@ You may select another namespace by using 'minikube service {{.service}} -n <nam
163163
for _, svc := range noNodePortServices {
164164
noNodePortSvcNames = append(noNodePortSvcNames, fmt.Sprintf("%s/%s", svc.Namespace, svc.Name))
165165
}
166-
if len(noNodePortServices) != 0 {
166+
if len(noNodePortServices) > 0 {
167167
out.WarningT("Services {{.svc_names}} have type \"ClusterIP\" not meant to be exposed, however for local development minikube allows you to access this !", out.V{"svc_names": noNodePortSvcNames})
168168
}
169169

170-
if driver.NeedsPortForward(co.Config.Driver) && services != nil {
171-
startKicServiceTunnel(services, cname, co.Config.Driver)
170+
if driver.NeedsPortForward(co.Config.Driver) {
171+
svcs := services
172+
if len(svcs) == 0 && len(noNodePortServices) > 0 {
173+
svcs = noNodePortServices
174+
}
175+
if len(svcs) > 0 {
176+
startKicServiceTunnel(svcs, cname, co.Config.Driver)
177+
}
172178
} else if !serviceURLMode {
173179
openURLs(data)
174-
if len(noNodePortServices) != 0 {
175-
startKicServiceTunnel(noNodePortServices, cname, co.Config.Driver)
176-
}
177-
178180
}
179181
},
180182
}

0 commit comments

Comments
 (0)