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

Failure of "minikube ip" returns "<nil>" with exit code 0 #8646

Closed
pre opened this issue Jul 5, 2020 · 7 comments · Fixed by #8820
Closed

Failure of "minikube ip" returns "<nil>" with exit code 0 #8646

pre opened this issue Jul 5, 2020 · 7 comments · Fixed by #8820
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@pre
Copy link

pre commented Jul 5, 2020

Steps to reproduce the issue:

  1. Have cluster on not-ready state
  2. Run "minikube ip"

Expected: exit code != 0 with empty output

Actual: exit code == 0
Output: <nil>

% minikube ip
<nil>
% echo $?
0

Minikube v1.11.0

Why is this a problem?
When minikube ip is used in a script, it'd be straightforward to read the exit code for whether the command succeeded. However, now the exit code is always "success" so the script needs to check for failure against a flaky string <nil> which may change at a later Minikube release.

@afbjorklund afbjorklund added the kind/bug Categorizes issue or PR as related to a bug. label Jul 6, 2020
@afbjorklund
Copy link
Collaborator

@pre : thanks for reporting this issue, it should not return nil like that. Which OS and which driver did this happen with ?

@afbjorklund afbjorklund added the priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. label Jul 6, 2020
@afbjorklund
Copy link
Collaborator

afbjorklund commented Jul 6, 2020

The problem is in the ControlPlaneEndpoint, which doesn't check the hostname or the return value of net.ParseIP

func ParseIP(s string) IP
ParseIP parses s as an IP address, returning the result. The string s can be
in dotted decimal ("192.0.2.1") or IPv6 ("2001:db8::68") form. If s is not a
valid textual representation of an IP address, ParseIP returns nil.

@pre
Copy link
Author

pre commented Jul 7, 2020

In case it matters, I have Minikube v1.11.0 on MacOS 10.15.5 with Hyperkit.

@Dean-Coakley
Copy link
Contributor

I'm taking a look at fixing this. But it's my first minikube contribution so if someone wants to take it first/take it over, let me know.

@medyagh
Copy link
Member

medyagh commented Jul 22, 2020

@Dean-Coakley are you still interested in making a PR for this ?

@medyagh medyagh added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. labels Jul 22, 2020
@medyagh
Copy link
Member

medyagh commented Jul 22, 2020

cc: @sharifelgamal

@sharifelgamal sharifelgamal added this to the v1.13.0 milestone Jul 22, 2020
@sharifelgamal sharifelgamal self-assigned this Jul 22, 2020
@Dean-Coakley
Copy link
Contributor

@medyagh I opened a PR that seems to resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants