Merge pull request #39496 from cpuguy83/fix_missing_dir_cleanup_file

Ensure parent dir exists for mount cleanup file
This commit is contained in:
Michael Crosby 2019-07-12 13:39:58 -04:00 committed by GitHub
commit a4a1e57e9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1290,6 +1290,10 @@ func setupDaemonRootPropagation(cfg *config.Config) error {
return nil
}
if err := os.MkdirAll(filepath.Dir(cleanupFile), 0700); err != nil {
return errors.Wrap(err, "error creating dir to store mount cleanup file")
}
if err := ioutil.WriteFile(cleanupFile, nil, 0600); err != nil {
return errors.Wrap(err, "error writing file to signal mount cleanup on shutdown")
}