Change:
<!-- Thanks for filing an issue! Before hitting the button, please answer these questions.--Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see ): What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): Is this a BUG REPORT or FEATURE REQUEST? (choose one): <!-- If this is a BUG REPORT, please: Fill in as much of the template below as you can. If you leave out information, we can't help you as well. If this is a FEATURE REQUEST, please: Describe in detail the feature/behavior/change you'd like to see. In both cases, be ready for followup questions, and please respond in a timely manner. If we can't reproduce a bug or think a feature already exists, we might close your issue. If we're wrong, PLEASE feel free to reopen it and explain why. --Kubernetes version (use ): Environment: Cloud provider or hardware configuration: OS (e.g. from /etc/os-release): Kernel (e.g. ): Install tools: Others: What happened: Using to start a cluster with only one node and found that there are some error logs in kubelet as following: What you expected to happen: How to reproduce it (as minimally and precisely as possible): Anything else we need to know:
cc
/cc
Seems caused by my env due to I cannot access gcr due to the proxy failed, will continue to check...
We should create the checkpoint directory when creating the checkpoint store, or else the list failed error will be quite spammy before a container is created.
Will push a fix soon.

Discussion:
path string } <ins> func NewFileStore(path string) (CheckpointStore, error) { if err := ensurePath(path); err != nil { return nil, err } return &FileStore{path: path}, nil } </ins> func (fstore *FileStore) Write(key string, data []byte) error { if err := validateKey(key); err != nil { return err } <del> if _, err := os.Stat(fstore.path); err != nil { // if directory already exists, proceed if err = os.MkdirAll(fstore.path, 0755); err != nil && !os.IsExist(err) { return err } </del> <ins> if err := ensurePath(fstore.path); err != nil { return err </ins> } tmpfile := filepath.Join(fstore.path, fmt.Sprintf("%s%s%s", tmpPrefix, key, tmpSuffix)) if err := ioutil.WriteFile(tmpfile, data, 0644); err != nil {

return filepath.Join(fstore.path, key) } <ins> // ensurePath creates input directory if it does not exist func ensurePath(path string) error { if _, err := os.Stat(path); err != nil { // MkdirAll returns nil if directory already exists return os.MkdirAll(path, 0755) } return nil } </ins> func validateKey(key string) error { if len(key) <= keyMaxLength && keyRegex.MatchString(key) { return nil

path, err := ioutil.TempDir("", "FileStore") assert.NoError(t, err) defer cleanUpTestPath(t, path) <del> store := &FileStore{path: path} </del> <ins> store, err := NewFileStore(path) assert.NoError(t, err) </ins> Checkpoints := []struct { key       string

store CheckpointStore } <del> func NewPersistentCheckpointHandler() CheckpointHandler { return &PersistentCheckpointHandler{store: &FileStore{path: filepath.Join(dockershimRootDir, sandboxCheckpointDir)}} </del> <ins> func NewPersistentCheckpointHandler() (CheckpointHandler, error) { fstore, err := NewFileStore(filepath.Join(dockershimRootDir, sandboxCheckpointDir)) if err != nil { return nil, err } return &PersistentCheckpointHandler{store: fstore}, nil </ins> } func (handler *PersistentCheckpointHandler) CreateCheckpoint(podSandboxID string, checkpoint *PodSandboxCheckpoint) error {

func NewDockerService(client dockertools.DockerInterface, seccompProfileRoot string, podSandboxImage string, streamingConfig *streaming.Config, pluginSettings *NetworkPluginSettings, cgroupsName string, kubeCgroupDriver string, execHandler dockertools.ExecHandler) (DockerService, error) { c := dockertools.NewInstrumentedDockerInterface(client) <ins> checkpointHandler, err := NewPersistentCheckpointHandler() if err != nil { return nil, err } </ins> ds := &dockerService{ seccompProfileRoot: seccompProfileRoot, client:             c,

execHandler: execHandler, }, containerManager:  cm.NewContainerManager(cgroupsName, client), <del> checkpointHandler: NewPersistentCheckpointHandler(), </del> <ins> checkpointHandler: checkpointHandler, </ins> } if streamingConfig != nil { var err error