Extract kubelet node status into separate file

This commit is contained in:
Paul Morie
2016-07-20 18:08:47 -04:00
parent 180e671972
commit 249da77371
5 changed files with 1594 additions and 1517 deletions

View File

@@ -18,6 +18,7 @@ package kubelet
import (
"fmt"
"os"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/capabilities"
@@ -118,3 +119,12 @@ func allowHostIPC(pod *api.Pod) (bool, error) {
}
return false, nil
}
// dirExists returns true if the path exists and represents a directory.
func dirExists(path string) bool {
s, err := os.Stat(path)
if err != nil {
return false
}
return s.IsDir()
}