Change log level for pod manifest

This commit is contained in:
xiangpengzhao 2017-07-25 19:05:32 +08:00
parent 55e045d9db
commit a4e04bb633
2 changed files with 7 additions and 7 deletions

View File

@ -73,7 +73,7 @@ func new(path string, nodeName types.NodeName, period time.Duration, updates cha
func (s *sourceFile) run() {
if err := s.watch(); err != nil {
glog.Errorf("unable to read manifest path %q: %v", s.path, err)
glog.Errorf("Unable to read manifest path %q: %v", s.path, err)
}
}
@ -136,22 +136,22 @@ func (s *sourceFile) extractFromDir(name string) ([]*v1.Pod, error) {
for _, path := range dirents {
statInfo, err := os.Stat(path)
if err != nil {
glog.V(1).Infof("Can't get metadata for %q: %v", path, err)
glog.Errorf("Can't get metadata for %q: %v", path, err)
continue
}
switch {
case statInfo.Mode().IsDir():
glog.V(1).Infof("Not recursing into manifest path %q", path)
glog.Errorf("Not recursing into manifest path %q", path)
case statInfo.Mode().IsRegular():
pod, err := s.extractFromFile(path)
if err != nil {
glog.V(1).Infof("Can't process manifest file %q: %v", path, err)
glog.Errorf("Can't process manifest file %q: %v", path, err)
} else {
pods = append(pods, pod)
}
default:
glog.V(1).Infof("Manifest path %q is not a directory or file: %v", path, statInfo.Mode())
glog.Errorf("Manifest path %q is not a directory or file: %v", path, statInfo.Mode())
}
}
return pods, nil

View File

@ -89,7 +89,7 @@ func (s *sourceFile) processEvent(e *inotify.Event) error {
var eventType podEventType
switch {
case (e.Mask & inotify.IN_ISDIR) > 0:
glog.V(1).Infof("Not recursing into manifest path %q", s.path)
glog.Errorf("Not recursing into manifest path %q", s.path)
return nil
case (e.Mask & inotify.IN_CREATE) > 0:
eventType = podAdd
@ -111,7 +111,7 @@ func (s *sourceFile) processEvent(e *inotify.Event) error {
switch eventType {
case podAdd, podModify:
if pod, err := s.extractFromFile(e.Name); err != nil {
glog.Errorf("can't process manifest file %q: %v", e.Name, err)
glog.Errorf("Can't process manifest file %q: %v", e.Name, err)
} else {
return s.store.Add(pod)
}