Skip to content

Commit 7f30bd5

Browse files
authored
Merge pull request containerd#70 from kevpar/empty-dir
Support kubernetes.io~empty-dir mounts for WCOW
2 parents dbcb702 + dfe0272 commit 7f30bd5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pkg/server/container_create_windows.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,12 @@ func (c *criService) generateContainerSpec(id string, sandboxID string, sandboxP
368368
return nil, errors.Errorf(`sandbox://' mounts are only supported for LCOW`, src)
369369
}
370370
mountType = "bind"
371-
} else if strings.Contains(src, "kubernetes.io~empty-dir") {
372-
if sandboxPlatform != "linux/amd64" {
373-
return nil, errors.Errorf(`kubernetes.io~empty-dir mounts are only supported for LCOW`, src)
374-
}
375-
371+
} else if strings.Contains(src, "kubernetes.io~empty-dir") && sandboxPlatform == "linux/amd64" {
372+
// kubernetes.io~empty-dir in the mount path indicates it comes from the kubernetes
373+
// empty-dir plugin, which creates an empty scratch directory to be shared between
374+
// containers in a pod. For LCOW, we special case this support and actually create
375+
// our own directory inside the UVM. For WCOW, we want to skip this conditional branch
376+
// entirely, and just treat the mount like a normal directory mount.
376377
subpaths := strings.SplitAfter(src, "kubernetes.io~empty-dir")
377378
if len(subpaths) < 2 {
378379
return nil, errors.Errorf("emptyDir %s must specify a source path", src)

0 commit comments

Comments
 (0)