-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Passing a CIDR to --subnet
panics on retries
#15516
Comments
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
I guess we could warn the user that we did not respect their passed subnet and we tried next closet available subnet |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Reproduce:
Root cause:
https://github.com/kubernetes/minikube/blob/master/pkg/network/network.go#L253
If we pass a CIDR to
--subnet
,net.ParseIP(currSubnet).To4()
returnsnil
and thennextSubnet[1] += byte(step)
panics.Solution:
One fix is to do the same as
inspect
https://github.com/kubernetes/minikube/blob/master/pkg/network/network.go#L129It does
ParseCIDR
first and then if that fails it falls back toParseIP
.If we do use
ParseCIDR
we should likely keep the user's original mask, so this will require a little logic.The bigger question might be that if a user passes us a specific subnet, should we increment the IP and retry at all? If a user is passing a subnet it's likely for good reason, so ignoring their value and incrementing seems like the wrong thing to do.
I propose that if no subnet is passed incrementing and retrying is fine, but if a user passes a subnet that we try the value and if it fails we completely fail. However, changing this logic could break existing implementations, so another option is we add a flag
--subnet-retry=false
the flag defaults to true to be backwards compatible.The text was updated successfully, but these errors were encountered: