mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Change log level for pod manifest
This commit is contained in:
parent
55e045d9db
commit
a4e04bb633
@ -73,7 +73,7 @@ func new(path string, nodeName types.NodeName, period time.Duration, updates cha
|
|||||||
|
|
||||||
func (s *sourceFile) run() {
|
func (s *sourceFile) run() {
|
||||||
if err := s.watch(); err != nil {
|
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 {
|
for _, path := range dirents {
|
||||||
statInfo, err := os.Stat(path)
|
statInfo, err := os.Stat(path)
|
||||||
if err != nil {
|
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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case statInfo.Mode().IsDir():
|
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():
|
case statInfo.Mode().IsRegular():
|
||||||
pod, err := s.extractFromFile(path)
|
pod, err := s.extractFromFile(path)
|
||||||
if err != nil {
|
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 {
|
} else {
|
||||||
pods = append(pods, pod)
|
pods = append(pods, pod)
|
||||||
}
|
}
|
||||||
default:
|
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
|
return pods, nil
|
||||||
|
@ -89,7 +89,7 @@ func (s *sourceFile) processEvent(e *inotify.Event) error {
|
|||||||
var eventType podEventType
|
var eventType podEventType
|
||||||
switch {
|
switch {
|
||||||
case (e.Mask & inotify.IN_ISDIR) > 0:
|
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
|
return nil
|
||||||
case (e.Mask & inotify.IN_CREATE) > 0:
|
case (e.Mask & inotify.IN_CREATE) > 0:
|
||||||
eventType = podAdd
|
eventType = podAdd
|
||||||
@ -111,7 +111,7 @@ func (s *sourceFile) processEvent(e *inotify.Event) error {
|
|||||||
switch eventType {
|
switch eventType {
|
||||||
case podAdd, podModify:
|
case podAdd, podModify:
|
||||||
if pod, err := s.extractFromFile(e.Name); err != nil {
|
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 {
|
} else {
|
||||||
return s.store.Add(pod)
|
return s.store.Add(pod)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user