diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index add01e155567..cb585ba73173 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -1365,7 +1365,7 @@ func validateFlags(cmd *cobra.Command, drvName string) { //nolint:gocyclo validateInsecureRegistry() } -// validatePorts validates that the --ports are not below 1024 for the host and not outside range +// validatePorts validates that the --ports are not outside range func validatePorts(ports []string) error { var exposedPorts, hostPorts, portSpecs []string for _, p := range ports { @@ -1386,19 +1386,19 @@ func validatePorts(ports []string) error { } } for _, p := range exposedPorts { - if err := validatePort(p, false); err != nil { + if err := validatePort(p); err != nil { return err } } for _, p := range hostPorts { - if err := validatePort(p, true); err != nil { + if err := validatePort(p); err != nil { return err } } return nil } -func validatePort(port string, isHost bool) error { +func validatePort(port string) error { p, err := strconv.Atoi(port) if err != nil { return errors.Errorf("Sorry, one of the ports provided with --ports flag is not valid: %s", port) @@ -1406,9 +1406,6 @@ func validatePort(port string, isHost bool) error { if p > 65535 || p < 1 { return errors.Errorf("Sorry, one of the ports provided with --ports flag is outside range: %s", port) } - if isHost && detect.IsMicrosoftWSL() && p < 1024 { - return errors.Errorf("Sorry, you cannot use privileged ports on the host (below 1024): %s", port) - } return nil }