Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

[17.12] Re-validate Mounts on container start#391

Merged
andrewhsu merged 1 commit intodocker-archive:17.12from
thaJeztah:17.12-backport-fix-mount-creation-on-start
Feb 20, 2018
Merged

[17.12] Re-validate Mounts on container start#391
andrewhsu merged 1 commit intodocker-archive:17.12from
thaJeztah:17.12-backport-fix-mount-creation-on-start

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

back port of moby/moby#35833 for 17.12

git checkout -b 17.12-backport-fix-mount-creation-on-start upstream/17.12
git cherry-pick -s -S -x -Xsubtree=components/engine 7cb96ba308dc53824d2203fd343a4a297d17976e

no conflicts

Validation of Mounts was only performed on container creation, not on
container start. As a result, if the host-path no longer existed
when the container was started, a directory was created in the given
location.

This is the wrong behavior, because when using the Mounts API, host paths
should never be created, and an error should be produced instead.

This patch adds a validation step on container start, and produces an
error if the host path is not found.

Validation of Mounts was only performed on container _creation_, not on
container _start_. As a result, if the host-path no longer existed
when the container was started, a directory was created in the given
location.

This is the wrong behavior, because when using the `Mounts` API, host paths
should never be created, and an error should be produced instead.

This patch adds a validation step on container start, and produces an
error if the host path is not found.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7cb96ba)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added this to the 17.12.1 milestone Jan 20, 2018
@thaJeztah
Copy link
Copy Markdown
Member Author

ping @cpuguy83 PTAL

Copy link
Copy Markdown
Contributor

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

@andrewhsu andrewhsu merged commit 5bc9635 into docker-archive:17.12 Feb 20, 2018
@thaJeztah thaJeztah deleted the 17.12-backport-fix-mount-creation-on-start branch February 20, 2018 08:40
docker-jenkins pushed a commit that referenced this pull request Oct 3, 2019
…t_docs_updates

[19.03 backport] API: update docs that /session left experimental in V1.39
Upstream-commit: 2ae5cbcf05d3f9941032582e2931bfe268d87cdc
Component: engine
silvin-lubecki pushed a commit to silvin-lubecki/docker-ce that referenced this pull request Feb 3, 2020
…ix-mount-creation-on-start

[17.12] Re-validate Mounts on container start
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.

3 participants