-
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
Make error message more human readable #5563
Conversation
Changes made: * service.go - changes to the error string returned * service_test.go - modify TestWaitAndMaybeOpenService test case to accomodate for the new changes
Hi @nanikjava. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: nanikjava The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Can one of the admins verify this patch? |
Travis tests have failedHey @nanikjava, 1st Buildmake test
TravisBuddy Request Identifier: 07ff37a0-e951-11e9-97f2-39e9ef4a9673 |
Codecov Report
@@ Coverage Diff @@
## master #5563 +/- ##
=========================================
+ Coverage 36.63% 37.23% +0.6%
=========================================
Files 102 103 +1
Lines 7346 7528 +182
=========================================
+ Hits 2691 2803 +112
- Misses 4298 4352 +54
- Partials 357 373 +16
|
pkg/minikube/service/service.go
Outdated
@@ -275,7 +275,7 @@ func WaitAndMaybeOpenService(api libmachine.API, namespace string, service strin | |||
chkSVC := func() error { return CheckService(namespace, service) } | |||
|
|||
if err := retry.Expo(chkSVC, time.Duration(interval)*time.Second, time.Duration(wait)*time.Second); err != nil { | |||
return errors.Wrapf(err, "Could not find finalized endpoint being pointed to by %s", service) | |||
return errors.Wrapf(err, "Service %s was not found in default namespace , please try with 'minikube service %s -n Y'", service, service) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this text, but it should detect if namespace
is default, otherwise the error message doesn't make much sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made changes to the string to include the service name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tstromberg any feedback ? Thanks
pkg/minikube/service/service_test.go
Outdated
@@ -824,6 +845,7 @@ func TestWaitAndMaybeOpenService(t *testing.T) { | |||
urlMode bool | |||
https bool | |||
err bool | |||
nondefault bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bools should never be negative or have a name that starts with with no
: it gets too confusing, particularly for non-english readers, when nondefault=false
. I also don't understand what this bool is the default of.
Instead of default
or nondefault
, I think this would be more readable if each test directly defined which servicesMap
to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will look into the test again and refactor to make it more readable for code structure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor the code to split out the test on it's own to make it more easier to understand for other. Let me know what you think ?. Thanks
… error text to include service name
/assign |
/ok-to-test |
pkg/minikube/service/service.go
Outdated
@@ -275,7 +275,7 @@ func WaitAndMaybeOpenService(api libmachine.API, namespace string, service strin | |||
chkSVC := func() error { return CheckService(namespace, service) } | |||
|
|||
if err := retry.Expo(chkSVC, time.Duration(interval)*time.Second, time.Duration(wait)*time.Second); err != nil { | |||
return errors.Wrapf(err, "Could not find finalized endpoint being pointed to by %s", service) | |||
return errors.Wrapf(err, "Service %s was not found in %s namespace , please try with 'minikube service %s -n Y'", service, namespace, service) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand properly, "Y" doesn't have a special meaning. What do you think about something like this:
Service %s was not found in the %q namespace. You may select another namespace by using:
'minikube service %s -n <namespace>'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense. PR has been updated. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
fixes #5271
Changes made:
for the new changes