Skip to content

Commit ce70245

Browse files
authored
Merge pull request #4863 from crosbymichael/log-dir
[cri] ensure log dir is created
2 parents 070b698 + 2e442ea commit ce70245

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pkg/cri/server/helpers_linux.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ func (c *criService) seccompEnabled() bool {
156156

157157
// openLogFile opens/creates a container log file.
158158
func openLogFile(path string) (*os.File, error) {
159+
if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {
160+
return nil, err
161+
}
159162
return os.OpenFile(path, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0640)
160163
}
161164

0 commit comments

Comments
 (0)