Commit 236b67a6 authored by Andy Cobaugh's avatar Andy Cobaugh
Browse files

start: be more accepting of output from `minikube service`, and check array...

start: be more accepting of output from `minikube service`, and check array length to avoid panic. Fixes #17
parent 08fa0271
Pipeline #192858 passed with stage
in 1 minute and 1 second
......@@ -571,8 +571,11 @@ func initHostsfile() (hostsfile.Hosts, string, error) {
if minikubeProvider() {
output := environment.RunAndGetOutputRequired("minikube", "service", "swagger-ui", "--url")
url := output[0]
urlPattern := regexp.MustCompile(`^http:\/\/([\w.-]+):([\d]+)$`)
urlPattern := regexp.MustCompile(`http:\/\/([\w.-]+):([\d]+)`)
urlParts := urlPattern.FindStringSubmatch(url)
if len(urlParts) <= 0 {
log.Fatal("Could not find swagger-ui URL in output of `minikube service swagger-ui --url`")
}
ip = urlParts[1]
} else if kindProvider() {
ip = "127.0.0.1"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment