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

Updated etcd-pod-dir-fetch logging. #4271

Merged
merged 2 commits into from
Feb 10, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/kubelet/config/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func (s *sourceEtcd) run() {
boundPods := api.BoundPods{}
err := s.helper.ExtractObj(s.key, &boundPods, false)
if err != nil {
if tools.IsEtcdNotFound(err) {
glog.V(4).Infof("etcd failed to retrieve the value for the key %q. Error: %v", s.key, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Might a more specific error message be appropriate / more helpful here? Does this mean it can't talk to etcd at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It means that the key is not present in etcd.
Since this is not really an error, we are reducing the verbosity to Info instead of it being Error.

Copy link
Contributor

Choose a reason for hiding this comment

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

May be overkill, but I would pull out into a msg:

msg := fmt.Sprintf("etcd failed to retrieve the value for the key %q. Error: %v", s.key, err)
if tools.IsEtcdNotFound(err) {
  glog.V(4).Infof(msg)
  return
}
glog.Errorf(msg)
return

Then again, I'm unsure if minute refactoring like this is used or frowned upon for this codebase.

return
}
glog.Errorf("etcd failed to retrieve the value for the key %q. Error: %v", s.key, err)
return
}
Expand Down