Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing only exposed port to --ports #15085

Merged
merged 1 commit into from
Oct 7, 2022

Conversation

spowelljr
Copy link
Member

@spowelljr spowelljr commented Oct 7, 2022

Fixes #14731

When port validation was added the case for just passing the port to expose was forgotten and made that possibility impossible.

Before:

$ minikube start --ports 8080
😄  minikube v1.27.0 on Darwin 12.6 (arm64)
✨  Automatically selected the docker driver. Other choices: ssh, qemu2 (experimental)

❌  Exiting due to MK_USAGE: Sorry, one of the ports provided with --ports flag is not valid [8080]

After:

$ minikube start --ports 8080
😄  minikube v1.27.0 on Darwin 12.6 (arm64)
✨  Automatically selected the docker driver. Other choices: ssh, qemu2 (experimental)
📌  Using Docker Desktop driver with root privileges
👍  Starting control plane node minikube in cluster minikube
🚜  Pulling base image ...
🔥  Creating docker container (CPUs=2, Memory=4000MB) ...
🐳  Preparing Kubernetes v1.25.2 on Docker 20.10.18 ...
❌  Unable to load cached images: loading cached images: stat /Users/powellsteven/.minikube/cache/images/arm64/registry.k8s.io/kube-controller-manager_v1.25.2: no such file or directory
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔎  Verifying Kubernetes components...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: default-storageclass
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

$  docker ps --format "{{.Ports}}"
0.0.0.0:64745->22/tcp, 0.0.0.0:64746->2376/tcp, 0.0.0.0:64748->5000/tcp, 0.0.0.0:64749->8080/tcp, 0.0.0.0:64750->8443/tcp, 0.0.0.0:64747->32443/tcp

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 7, 2022
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 7, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh, spowelljr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@spowelljr spowelljr merged commit 399a60e into kubernetes:master Oct 7, 2022
@spowelljr spowelljr deleted the fixPortValidation branch October 7, 2022 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Randomly mapping host ports no longer works
3 participants