Merge pull request #16643 from spowelljr/bootpdError

QEMU: Add advice if bootpd blocked by firewall
pull/16649/head
Steven Powell 2023-06-07 12:18:22 -07:00 committed by GitHub
commit c47da33425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -41,6 +41,8 @@ import (
"github.com/pkg/errors"
pkgdrivers "k8s.io/minikube/pkg/drivers"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/reason"
"k8s.io/minikube/pkg/network"
)
@ -494,6 +496,9 @@ func (d *Driver) Start() error {
}
if err != nil {
if isBootpdError(err) {
exit.Error(reason.IfBootpdFirewall, "ip not found", err)
}
return errors.Wrap(err, "IP address never found in dhcp leases file")
}
log.Debugf("IP: %s", d.IPAddress)
@ -504,6 +509,13 @@ func (d *Driver) Start() error {
return WaitForTCPWithDelay(fmt.Sprintf("%s:%d", d.IPAddress, d.SSHPort), time.Second)
}
func isBootpdError(err error) bool {
if runtime.GOOS != "darwin" {
return false
}
return strings.Contains(err.Error(), "could not find an IP address")
}
func cmdOutErr(cmdStr string, args ...string) (string, string, error) {
cmd := exec.Command(cmdStr, args...)
log.Debugf("executing: %s %s", cmdStr, strings.Join(args, " "))

View File

@ -396,6 +396,14 @@ var (
IfSSHClient = Kind{ID: "IF_SSH_CLIENT", ExitCode: ExLocalNetworkError}
// minikube failed to create a dedicated network
IfDedicatedNetwork = Kind{ID: "IF_DEDICATED_NETWORK", ExitCode: ExLocalNetworkError}
// minikube failed to populate dchpd_leases file due to bootpd being blocked by firewall
IfBootpdFirewall = Kind{
ID: "ID_BOOTPD_FIREWALL",
ExitCode: ExLocalNetworkError,
Advice: translate.T(`Your firewall is likely blocking bootpd, to unblock it run:
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/libexec/bootpd
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblock /usr/libexec/bootpd`),
}
// minikube failed to cache kubernetes binaries for the current runtime
InetCacheBinaries = Kind{ID: "INET_CACHE_BINARIES", ExitCode: ExInternetError}