-
Notifications
You must be signed in to change notification settings - Fork 303
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
split the error message in backend syncer health processing #864
Conversation
cc @skmatti |
pkg/backends/backends.go
Outdated
@@ -163,7 +163,7 @@ func (b *Backends) Delete(name string, version meta.Version, scope meta.KeyType) | |||
func (b *Backends) Health(name string, version meta.Version, scope meta.KeyType) (string, error) { | |||
be, err := b.Get(name, version, scope) | |||
if err != nil || len(be.Backends) == 0 { | |||
return "Unknown", fmt.Errorf("error getting health for backend %s: %v", name, err) | |||
return "Unknown", fmt.Errorf("error getting backend %s: %v", name, err) |
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.
%q. Same below as well.
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.
done
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: freehan, rramkumar1 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 |
@@ -163,7 +163,7 @@ func (b *Backends) Delete(name string, version meta.Version, scope meta.KeyType) | |||
func (b *Backends) Health(name string, version meta.Version, scope meta.KeyType) (string, error) { | |||
be, err := b.Get(name, version, scope) | |||
if err != nil || len(be.Backends) == 0 { | |||
return "Unknown", fmt.Errorf("error getting health for backend %s: %v", name, err) | |||
return "Unknown", fmt.Errorf("error getting backend %q: %v", name, err) |
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.
can we separate out the cases here
if err != nil {
return "Unknown", fmt.Errorf("error betting backend...", ...)
}
if len(be.Backends) == 0 {
return "Unknown", fmt.Errorf("backend list is empty...", ...)
}
return "Unknown", fmt.Errorf("error getting health for backend %q: %v", name, err) | ||
} | ||
if len(hs.HealthStatus) == 0 || hs.HealthStatus[0] == nil { |
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.
Why would we get a nil in the first element? seems incorrect (somewhere).
In the first sync for an ingress, this log line usually gets emitted:
Usually shortly after Backends are attached to Backend-Services, there is no health status. Hence result in the log line.