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] Man pages: refactor common options: --volume #15706

Merged

Conversation

edsantiago
Copy link
Member

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 #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 #8519.

The "Propagation property...bind mounted" sentence first appeared
in pod-clone, in #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 [email protected]

None

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 8, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 8, 2022
Copy link
Member Author

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

I've made comments on what I think are the riskiest changes. There are tons more changes, but those are mostly backticks asterisks underscore type stuff. I think.

This is really impossible to review. My only suggestion is, ignore the man pages, read ONLY the new volume.md file, and think about whether every single word in it applies to each of the four man pages.

TIA.

Comment on lines +11 to +20
* **rw**|**ro**
* **z**|**Z**
* [**O**]
* [**U**]
* [**no**]**copy**
* [**no**]**dev**
* [**no**]**exec**
* [**no**]**suid**
* [**r**]**bind**
* [**r**]**shared**|[**r**]**slave**|[**r**]**private**[**r**]**unbindable**
Copy link
Member Author

Choose a reason for hiding this comment

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

The list of options was reordered 2022-06-28 by Giuseppe in #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.

Comment on lines +134 to +135
Propagation property can be specified only for bind mounted volumes and not for
internal volumes or named volumes. For mount propagation to work the source mount
Copy link
Member Author

Choose a reason for hiding this comment

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

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

Copy link
Member

Choose a reason for hiding this comment

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

I believe this is correct for all.

* **z**|**Z**
* [**O**]
* [**U**]
* [**no**]**copy**
Copy link
Member Author

Choose a reason for hiding this comment

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

The "copy" option was not present in the pod-* man pages, but it
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.

Copy link
Member

Choose a reason for hiding this comment

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

Yes this should work.

Note: Do not relabel system files and directories. Relabeling system content
might cause other confined services on your machine to fail. For these types
of containers we recommend disabling SELinux separation. The option
**--security-opt label=disable** disables SELinux separation for the <<container|pod>>.
Copy link
Member Author

Choose a reason for hiding this comment

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

This used to say "...for containers used in the build". Maybe a leftover from podman-build? Anyhow, I ditched that.

Copy link
Member

Choose a reason for hiding this comment

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

Good, this is correct.

Comment on lines +97 to +101
For advanced users, the **overlay** option also supports custom non-volatile
**upperdir** and **workdir** for the overlay mount. Custom **upperdir** and
**workdir** can be fully managed by the users themselves, and Podman will not
remove it on lifecycle completion.
Example **:O,upperdir=/some/upper,workdir=/some/work**
Copy link
Member Author

Choose a reason for hiding this comment

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

This paragraph was present only in podman-run. I chose to include it here, in the reference copy, so now it will show up in all those man pages. If that is wrong, someone please yell.

Copy link
Member

Choose a reason for hiding this comment

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

Should be the same for all.

Comment on lines 82 to 85
For example if a user wanted to volume mount their entire home directory into a
<<container|pod>>, they need to disable SELinux separation.

$ podman <<subcommand>> --security-opt label=disable -v $HOME:/home/user fedora touch /home/user/file
Copy link
Member Author

Choose a reason for hiding this comment

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

And actually this entire paragraph (starting with "Note: Do not relabel") was present only in the podman-create and -run man pages, not in the pod-* ones. I choose to include it now in all. If this is wrong, please yell.

Oh, and, the <<subcommand>> on pod pages will show podman create/run, not podman pod create/run. I need to fix that, but it won't be today.

Copy link
Member

Choose a reason for hiding this comment

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

It should be everywhere.

@rhatdan
Copy link
Member

rhatdan commented Sep 9, 2022

LGTM
@giuseppe @mheon PTAL

@rhatdan
Copy link
Member

rhatdan commented Sep 9, 2022

@containers/podman-maintainers PTAL


Create a bind mount. If `-v /HOST-DIR:/CONTAINER-DIR` is specified, Podman
bind mounts `/HOST-DIR` in the host to `/CONTAINER-DIR` in the Podman
container. Similarly, `-v SOURCE-VOLUME:/CONTAINER-DIR` will mount the volume
Copy link
Member

Choose a reason for hiding this comment

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

mount the named volume from the host into the container

Copy link
Member

Choose a reason for hiding this comment

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

Does Buildah support named volumes?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, no podman build manpage changes in here, OK. Ignore my earlier question.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. Just to make ultra-sure, here is what the new diff looks like:

 Create a bind mount. If `-v /HOST-DIR:/CONTAINER-DIR` is specified, Podman
 bind mounts `/HOST-DIR` in the host to `/CONTAINER-DIR` in the Podman
-container. Similarly, `-v SOURCE-VOLUME:/CONTAINER-DIR` will mount the volume
-in the host to the container. If no such named volume exists, Podman will
+container. Similarly, `-v SOURCE-VOLUME:/CONTAINER-DIR` will mount the named
+volume from the host into the container. If no such named volume exists, Podman will
 create one. (Note ....

Copy link
Member

Choose a reason for hiding this comment

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

LGTM

The `CONTAINER-DIR` must be an absolute path such as `/src/docs`. The volume
will be mounted into the container at this directory.

Volumes may specify a source as well, as either a directory on the host
Copy link
Member

Choose a reason for hiding this comment

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

This feels like it should be combined with the first paragraph

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry to be really dense, but this is not my area of expertise. Could you give me a precise diff for me to apply, or defer this for a (much-needed) future man page cleanup? This option has taken a lot out of me, and I'm feeling nervous enough about it as it is. I don't trust my judgment enough to make this change on my own.

Copy link
Member

Choose a reason for hiding this comment

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

Remove the first sentence, and graft the remainder of the paragraph onto the end of the first paragraph.

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 <[email protected]>
@edsantiago
Copy link
Member Author

Re-pushed with @mheon's fixed wording and with a new <<fullsubcommand>> for the command example.

@rhatdan
Copy link
Member

rhatdan commented Sep 9, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 9, 2022
@openshift-merge-robot openshift-merge-robot merged commit 94864cb into containers:main Sep 9, 2022
@edsantiago edsantiago deleted the docs_dedup_volume branch September 9, 2022 15:29
@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 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 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. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants