Skip to content

Commit 8d78761

Browse files
authored
Merge pull request containerd#10534 from k8s-infra-cherrypick-robot/cherry-pick-10516-to-release/1.7
[release/1.7] Ensure /run/containerd gets created with correct perms
2 parents 97a5245 + 16c5fc7 commit 8d78761

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

services/server/server.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ func CreateTopLevelDirectories(config *srvconfig.Config) error {
8484
if err := sys.MkdirAllWithACL(config.State, 0711); err != nil {
8585
return err
8686
}
87+
if config.State != defaults.DefaultStateDir {
88+
// XXX: socketRoot in pkg/shim is hard-coded to the default state directory.
89+
// See https://github.com/containerd/containerd/issues/10502#issuecomment-2249268582 for why it's set up that way.
90+
// The default fifo directory in pkg/cio is also configured separately and defaults to the default state directory instead of the configured state directory.
91+
// Make sure the default state directory is created with the correct permissions.
92+
if err := sys.MkdirAllWithACL(defaults.DefaultStateDir, 0o711); err != nil {
93+
return err
94+
}
95+
}
8796

8897
if config.TempDir != "" {
8998
if err := sys.MkdirAllWithACL(config.TempDir, 0711); err != nil {

0 commit comments

Comments
 (0)