Skip to content

Add proper error message to OVS health check #17890

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

Merged

Conversation

imcsk8
Copy link
Contributor

@imcsk8 imcsk8 commented Dec 19, 2017

The healtFn and alreadySetup functions were returning a boolean
and they should return an error with information in case of
failures.

Fixes: bz#1504011

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 19, 2017
@imcsk8
Copy link
Contributor Author

imcsk8 commented Dec 19, 2017

PTAL @openshift/networking

Copy link
Contributor

@knobunc knobunc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start. Some nits though.

if !healthFn() {
return false, fmt.Errorf("OVS health check failed")
if err := healthFn(); err != nil {
return false, fmt.Errorf("OVS health check failed, %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about: "OVS health check failed: %v"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, i'll change it

@@ -78,12 +79,12 @@ func (plugin *OsdnNode) alreadySetUp(localSubnetGatewayCIDR string, clusterNetwo
}
}
if !found {
return false
return errors.New("Local subnet gateway CIDR not found")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Errors are usually lowercase (as @pravisankar keeps reminding me)

Same for the following errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean that they should start with a lowercase letter like this? "local subnet gateway CIDR not found"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 22, 2017
imcsk8 added 2 commits January 3, 2018 13:11
The healtFn and alreadySetup functions were returning a boolean
and they should return an error with information in case of
failures.

Fixes: bz#1504011
@imcsk8 imcsk8 force-pushed the healthcheck-error-message branch from 6972988 to fd3af25 Compare January 3, 2018 21:02
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 3, 2018
Copy link
Contributor

@knobunc knobunc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Thanks!

@knobunc
Copy link
Contributor

knobunc commented Jan 3, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 3, 2018
@knobunc
Copy link
Contributor

knobunc commented Jan 3, 2018

/approve

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: imcsk8, knobunc

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@knobunc
Copy link
Contributor

knobunc commented Jan 3, 2018

/retest

@@ -96,7 +97,7 @@ func deleteLocalSubnetRoute(device, localSubnetCIDR string) {
})

if err != nil {
glog.Errorf("Error removing %s route from dev %s: %v; if the route appears later it will not be deleted.", localSubnetCIDR, device, err)
glog.Errorf("error removing %s route from dev %s: %v; if the route appears later it will not be deleted.", localSubnetCIDR, device, err)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our convention is user returned errors start with lower case and log messages start with upper case. In this case 'Error removing...' is fine as this is a log msg.

Copy link

@pravisankar pravisankar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit, otherwise LGTM

@knobunc
Copy link
Contributor

knobunc commented Jan 4, 2018

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue.

@openshift-merge-robot openshift-merge-robot merged commit a2f90ac into openshift:master Jan 7, 2018
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. component/networking lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants