Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

mounts: fix isSystemMount check for mountSharedDirMounts#1623

Merged
jodh-intel merged 1 commit intokata-containers:masterfrom
awprice:system-mount-skip
May 9, 2019
Merged

mounts: fix isSystemMount check for mountSharedDirMounts#1623
jodh-intel merged 1 commit intokata-containers:masterfrom
awprice:system-mount-skip

Conversation

@awprice
Copy link
Contributor

@awprice awprice commented May 3, 2019

This change updates the isSystemMount check for mountSharedDirMounts
when setting up shared directory mounts for the container and uses
the source of the mount instead of the destination for the check.

We want to exclude system mounts from the host side as they
shouldn't be mounted into the container.

We do however want to allow system mounts within the
container as denying them can prevent some containers from
running properly.

Fixes #1591

Signed-off-by: Alex Price aprice@atlassian.com

This change updates the isSystemMount check for mountSharedDirMounts
when setting up shared directory mounts for the container and uses
the source of the mount instead of the destination for the check.

We want to exclude system mounts from the host side as they
shouldn't be mounted into the container.

We do however want to allow system mounts within the
container as denying them can prevent some containers from
running properly.

Fixes kata-containers#1591

Signed-off-by: Alex Price <aprice@atlassian.com>
@grahamwhaley grahamwhaley requested review from amshinde and sboeuf May 3, 2019 08:47
@grahamwhaley
Copy link
Contributor

/test
/cc @amshinde

Copy link
Contributor

@mcastelino mcastelino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM This should work I think. I do not see any issue. /cc @amshinde ?

// Skip mounting certain system paths from the source on the host side
// into the container as it does not make sense to do so.
// Example sources could be /sys/fs/cgroup etc.
if isSystemMount(m.Source) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@awprice Your comment makes sense, we do not mount certain system paths from the host side into the guest, however it makes sense to do so for system paths that are docker volumes and k8s empty dirs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using containerd, maybe we need to update the logic to handle docker volumes, k8s empty dirs and containerd volumes?

I don't think containerd volumes have been factored in here and that's probably why we are running into this issue, as we don't use docker.

@jodh-intel
Copy link

Only the single centos CI failure which is known (#1604), so merging...

@jodh-intel jodh-intel merged commit bb44f65 into kata-containers:master May 9, 2019
@awprice awprice deleted the system-mount-skip branch May 10, 2019 04:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Certain Dockerfile volumes preventing pod start

7 participants