Add e2e node test for log path

Update to use pod to check log file
This commit is contained in:
Harry Zhang
2016-10-15 00:32:50 -04:00
parent c41c24fbf3
commit 64c8d3ad3d
3 changed files with 128 additions and 8 deletions

View File

@@ -100,7 +100,7 @@ const (
nodeStatusUpdateRetry = 5
// Location of container logs.
containerLogsDir = "/var/log/containers"
ContainerLogsDir = "/var/log/containers"
// max backoff period, exported for the e2e test
MaxContainerBackOff = 300 * time.Second
@@ -619,7 +619,7 @@ func NewMainKubelet(kubeCfg *componentconfig.KubeletConfiguration, kubeDeps *Kub
kubeCfg.PodInfraContainerImage,
float32(kubeCfg.RegistryPullQPS),
int(kubeCfg.RegistryBurst),
containerLogsDir,
ContainerLogsDir,
kubeDeps.OSInterface,
klet.networkPlugin,
klet,
@@ -1149,9 +1149,9 @@ func (kl *Kubelet) initializeModules() error {
}
// Step 3: If the container logs directory does not exist, create it.
if _, err := os.Stat(containerLogsDir); err != nil {
if err := kl.os.MkdirAll(containerLogsDir, 0755); err != nil {
glog.Errorf("Failed to create directory %q: %v", containerLogsDir, err)
if _, err := os.Stat(ContainerLogsDir); err != nil {
if err := kl.os.MkdirAll(ContainerLogsDir, 0755); err != nil {
glog.Errorf("Failed to create directory %q: %v", ContainerLogsDir, err)
}
}