Skip to content

Commit

Permalink
feat: check connectivity outside minikube once it fails
Browse files Browse the repository at this point in the history
  • Loading branch information
ComradeProgrammer committed Jun 2, 2024
1 parent 7777113 commit b6e7cf2
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions pkg/minikube/node/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,14 +856,28 @@ func tryRegistry(r command.Runner, driverName, imageRepository, ip string) {
}

opts = append(opts, fmt.Sprintf("https://%s/", imageRepository))
if rr, err := r.RunCmd(exec.Command("curl", opts...)); err != nil {
cmd := exec.Command("curl", opts...)
if rr, err := r.RunCmd(cmd); err != nil {
outside := true
klog.Warningf("%s failed: %v", rr.Args, err)
out.WarningT("This {{.type}} is having trouble accessing https://{{.repository}}", out.V{"repository": imageRepository, "type": driver.MachineType(driverName)})
out.ErrT(style.Tip, "To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/")

// using QEMU with the user network
if driver.IsQEMU(driverName) && ip == "127.0.0.1" {
out.WarningT("Due to DNS issues your cluster may have problems starting and you may not be able to pull images\nMore details available at: https://minikube.sigs.k8s.io/docs/drivers/qemu/#known-issues")
}
// now we shall also try whether this registry is reachable outside the machine
// so that we can tell in the logs that if the user's computer had any network issue or could it be related to a network module config change in minikbue ISO
if err := cmd.Run(); err != nil {
outside = false
}
if !outside {
// both inside and outside failed
out.WarningT("This {{.type}} is also having trouble accessing https://{{.repository}} both inside and outside the minikube ", out.V{"repository": imageRepository, "type": driver.MachineType(driverName)})
} else {
// only inside the minikube failed
out.WarningT("This {{.type}} is having trouble accessing https://{{.repository}} only inside the minikube", out.V{"repository": imageRepository, "type": driver.MachineType(driverName)})
}
out.ErrT(style.Tip, "To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/")
}
}

Expand Down

0 comments on commit b6e7cf2

Please sign in to comment.