Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI:DOCS] Document volume mounts of source directories do NOT get created #8519

Merged
merged 1 commit into from
Dec 1, 2020

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Nov 30, 2020

We differ from Docker, in that we do not create the source directory
in a --volume mount if it does not exists. We return an error.

We do not believe that a typo from the user should cause a directory
to be created and silently ignored by Podman.

Fixes: #8513

Signed-off-by: Daniel J Walsh dwalsh@redhat.com

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 30, 2020
@rhatdan
Copy link
Member Author

rhatdan commented Nov 30, 2020

@TomSweeneyRedHat PTAL

Volumes may specify a source as well, as either a directory on the host or the
name of a named volume. If no source is given, the volume will be created as an
Volumes may specify a source as well, as either a directory on the host
or the name of a named volume. If no source is given, the volume will be created as an
anonymous named volume with a randomly generated name, and will be removed when
Copy link
Member

Choose a reason for hiding this comment

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

old, but could you change "anonymous" to "anonymously"

with names are not anonymous. They are not removed by the `--rm` option and the
`podman rm --volumes` command.
are resolved relative to the directory Podman is run in. If the source does not
exists, Podman will return and error. Users must pre-create the source files or
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
exists, Podman will return and error. Users must pre-create the source files or
exist, Podman will return an error. Users must pre-create the source files or

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed


Any source that does not begin with a `.` or `/` will be treated as the name of
a named volume. If a volume with that name does not exist, it will be created.
Volumes created with names are not anonymous. They are not removed by the `--rm`
Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat Nov 30, 2020

Choose a reason for hiding this comment

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

suggest just to be clear that you're talking about named and not anonymous volumes

Suggested change
Volumes created with names are not anonymous. They are not removed by the `--rm`
Volumes created with names are not anonymous, and they are not removed by the `--rm`

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

Volumes may specify a source as well, as either a directory on the host or the
name of a named volume. If no source is given, the volume will be created as an
Volumes may specify a source as well, as either a directory on the host
or the name of a named volume. If no source is given, the volume will be created as an
anonymous named volume with a randomly generated name, and will be removed when
Copy link
Member

Choose a reason for hiding this comment

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

if you go with anonymously above, do here too please.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

with names are not anonymous and are not removed by **--rm** and
**podman rm --volumes**.
are resolved relative to the directory Podman is run in. If the source does not
exists, Podman will return and error. Users must pre-create the source files or
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
exists, Podman will return and error. Users must pre-create the source files or
exists, Podman will return an error. Users must pre-create the source files or

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed


Any source that does not begin with a `.` or `/` will be treated as the name of
a named volume. If a volume with that name does not exist, it will be created.
Volumes created with names are not anonymous. They are not removed by the `--rm`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Volumes created with names are not anonymous. They are not removed by the `--rm`
Volumes created with names are not anonymous, and they are not removed by the `--rm`

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@rhatdan
Copy link
Member Author

rhatdan commented Nov 30, 2020

@TomSweeneyRedHat PTAL
@containers/podman-maintainers PTAL

Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat left a comment

Choose a reason for hiding this comment

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

Except for the exist/exists mess that I contributed to, LGTM. I've hit all of them with a grammar checker to make sure my tired noodle wasn't still messing up and I believe they are right with my current suggestions.

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM. Totally agree with the decision. I made the very same choice in the WIP work for podman-cp. It currently would create a path on the container if doesn't exist and I find this kind of magic dangerous - as you said, a typo would be masked and deployments can break in hard to debug ways.

We differ from Docker, in that we do not create the source directory
in a --volume mount if it does not exists.  We return an error.

We do not believe that a `typo` from the user should cause a directory
to be created and silently ignored by Podman.

Fixes: containers#8513

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Copy link
Collaborator

@QiWang19 QiWang19 left a comment

Choose a reason for hiding this comment

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

LGTM

@TomSweeneyRedHat
Copy link
Member

LGTM

@TomSweeneyRedHat
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 1, 2020
@openshift-merge-robot openshift-merge-robot merged commit 1316b29 into containers:master Dec 1, 2020
edsantiago added a commit to edsantiago/libpod that referenced this pull request Sep 8, 2022
This one is a nightmare, because --volume has been edited
in four different files throughout the years (five if you
count podman-build, which I am not including in this PR).
Those edits have not always been done in sync.

The list of options was reordered 2022-06-28 by Giuseppe in containers#14734,
but only in podman-create and -run (not in podman-pod-*). No
explanation of why, but I'll assume he knew what he was doing,
and have accepted that for the reference copy.

There was also a big edit in containers#8519.

The "Propagation property...bind mounted" sentence first appeared
in pod-clone, in containers#14299 by cdoern, with no obvious source of where
it came from. I choose to include it in the reference copy.

The "**copy**" option seems to work in pod-create, so I'm including
it in the reference copy. Someone please yell loudly if this is
not the case.

The "disables SELinux separation for containers used in the build",
no idea, changed that to just "for the container/pod"

The "advanced users / overlay / upperdir / workdir" paragraph
makes zero sense to me, but hey, I assume it applies to all
the commands, so I put it in the reference copy.

Finally, there's still a mishmash of backticks, asterisks, underscores,
and even quotation marks. Someone is gonna have to perform major
cleanup on this one day, but at least it'll be in only one place.

Signed-off-by: Ed Santiago <santiago@redhat.com>
edsantiago added a commit to edsantiago/libpod that referenced this pull request Sep 9, 2022
This one is a nightmare, because --volume has been edited
in four different files throughout the years (five if you
count podman-build, which I am not including in this PR).
Those edits have not always been done in sync.

The list of options was reordered 2022-06-28 by Giuseppe in containers#14734,
but only in podman-create and -run (not in podman-pod-*). No
explanation of why, but I'll assume he knew what he was doing,
and have accepted that for the reference copy.

There was also a big edit in containers#8519.

The "Propagation property...bind mounted" sentence first appeared
in pod-clone, in containers#14299 by cdoern, with no obvious source of where
it came from. I choose to include it in the reference copy.

The "**copy**" option seems to work in pod-create, so I'm including
it in the reference copy. Someone please yell loudly if this is
not the case.

The "disables SELinux separation for containers used in the build",
no idea, changed that to just "for the container/pod"

The "advanced users / overlay / upperdir / workdir" paragraph
makes zero sense to me, but hey, I assume it applies to all
the commands, so I put it in the reference copy.

Finally, there's still a mishmash of backticks, asterisks, underscores,
and even quotation marks. Someone is gonna have to perform major
cleanup on this one day, but at least it'll be in only one place.

Signed-off-by: Ed Santiago <santiago@redhat.com>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker CLI incompatibility missing volume creation
6 participants