Skip to content

Commit eb5f4b2

Browse files
committed
Set Mount Propagation in ContainerStatus
1 parent 9a8a9fe commit eb5f4b2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

core/container_status.go

+13
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ package core
1919
import (
2020
"context"
2121
"fmt"
22+
23+
dockermounttypes "github.com/docker/docker/api/types/mount"
24+
2225
"github.com/Mirantis/cri-dockerd/libdocker"
2326
"github.com/sirupsen/logrus"
2427
v1 "k8s.io/cri-api/pkg/apis/runtime/v1"
@@ -61,11 +64,21 @@ func (ds *dockerService) ContainerStatus(
6164
for i := range r.Mounts {
6265
m := r.Mounts[i]
6366
readonly := !m.RW
67+
var propagation v1.MountPropagation
68+
switch m.Propagation {
69+
case dockermounttypes.PropagationPrivate:
70+
propagation = v1.MountPropagation_PROPAGATION_PRIVATE
71+
case dockermounttypes.PropagationRShared:
72+
propagation = v1.MountPropagation_PROPAGATION_BIDIRECTIONAL
73+
case dockermounttypes.PropagationRSlave:
74+
propagation = v1.MountPropagation_PROPAGATION_HOST_TO_CONTAINER
75+
}
6476
mounts = append(mounts, &v1.Mount{
6577
HostPath: m.Source,
6678
ContainerPath: m.Destination,
6779
Readonly: readonly,
6880
// Note: Can't set SeLinuxRelabel
81+
Propagation: propagation,
6982
})
7083
}
7184
// Interpret container states.

0 commit comments

Comments
 (0)