Commit cb42bd47 authored by k8s-merge-robot's avatar k8s-merge-robot

Merge pull request #18027 from roboll/runonce-datadirs

Auto commit by PR queue bot
parents 7c43797e 81b9097a
...@@ -18,6 +18,7 @@ package kubelet ...@@ -18,6 +18,7 @@ package kubelet
import ( import (
"fmt" "fmt"
"os"
"time" "time"
"github.com/golang/glog" "github.com/golang/glog"
...@@ -42,6 +43,18 @@ type RunPodResult struct { ...@@ -42,6 +43,18 @@ type RunPodResult struct {
// RunOnce polls from one configuration update and run the associated pods. // RunOnce polls from one configuration update and run the associated pods.
func (kl *Kubelet) RunOnce(updates <-chan kubetypes.PodUpdate) ([]RunPodResult, error) { func (kl *Kubelet) RunOnce(updates <-chan kubetypes.PodUpdate) ([]RunPodResult, error) {
// Setup filesystem directories.
if err := kl.setupDataDirs(); err != nil {
return nil, err
}
// If the container logs directory does not exist, create it.
if _, err := os.Stat(containerLogsDir); err != nil {
if err := kl.os.Mkdir(containerLogsDir, 0755); err != nil {
glog.Errorf("Failed to create directory %q: %v", containerLogsDir, err)
}
}
select { select {
case u := <-updates: case u := <-updates:
glog.Infof("processing manifest with %d pods", len(u.Pods)) glog.Infof("processing manifest with %d pods", len(u.Pods))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment