Skip to content

Needs review: Make the documentation of user namespace options in podman-run clearer#1380

Closed
najamelan wants to merge 2 commits intocontainers:masterfrom
najamelan:documentation/user_namespaces
Closed

Needs review: Make the documentation of user namespace options in podman-run clearer#1380
najamelan wants to merge 2 commits intocontainers:masterfrom
najamelan:documentation/user_namespaces

Conversation

@najamelan
Copy link
Contributor

This proposes a more comprehensible man page.

A number of things have been lost in translation and this should be reviewed:

  • the former docs from --userns say that it is disabled by default. I suppose that this is the same as --userns:host, but this should be confirmed. It also stated that is would use options like pid=host, which confuses me as pid namespaces are a totally different thing from user namespaces. It also mentions the enabling of --privileged. I think the difference between using --userns:host and not using any user namespace options at all is not clear and maybe not very logical. Also what would be the difference between using --userns:host and using --priveleged alone?
  • I found the syntax for --gidmap at the bottom of the man page in the examples. In the example it doesn't use '=', eg. podman run --gidmap 0:30000:2000. For consistency with the other options I have used '=' for now, but if it is optional, I would remove it everywhere, as less tokens is usually improved readability. For now the inconsistency remains between the options doc and the examples section.
  • It wasn't very clear to me whether one should hard wrap long lines or not as the file contains a mix.
  • I haven't for now looked at user namespace options on other commands, but that should be done surely before merging.
  • I didn't know which command to run to generate the groff, so that needs doing still.

from issue #1374

Signed-off-by: Naja Melan najamelan@autistici.org

This proposes a more comprehensible man page.

A number of things have been lost in translation and this should be reviewed:
- the former docs from --userns say that it is disabled by default. I
  suppose that this is the same as --userns:host, but this should be confirmed.
  It also stated that is would use options like pid=host, which confuses me
  as pid namespaces are a totally different thing from user namespaces. It also
  mentions the enabling of --privileged. I think the difference between using
  --userns:host and not using any user namespace options at all is not clear
  and maybe not very logical. Also what would be the difference between using
  --userns:host and using --priveleged alone?
- I found the syntax for --gidmap at the bottom of the man page in the examples.
  In the example it doesn't use '=', eg. podman run `--gidmap 0:30000:2000`.
  For consistency with the other options I have used '=' for now, but if it is
  optional, I would remove it everywhere, as less tokens is usually improved
  readability. For now the inconsistency remains between the options doc and the
  examples section.
- It wasn't very clear to me whether one should hard wrap long lines or not as the
  contains a mix.
- I haven't for now looked at user namespace options on other commands, but
  that should be done surely before merging.
- I didn't know which command to run to generate the groff, so that needs doing still.

from issue containers#1374

Signed-off-by: Naja Melan <najamelan@autistici.org>

Signed-off-by: Naja Melan <najamelan@autistici.org>
@rh-atomic-bot
Copy link
Collaborator

Can one of the admins verify this patch?
I understand the following commands:

  • bot, add author to whitelist
  • bot, test pull request
  • bot, test pull request once

@mheon
Copy link
Member

mheon commented Aug 30, 2018

bot, add author to whitelist

@mheon
Copy link
Member

mheon commented Aug 30, 2018

Docs changes LGTM

@mheon
Copy link
Member

mheon commented Aug 30, 2018

bot, retest this please

**--subgidname**=name

Name for GID map from the `/etc/subgid` file. Using this flag will run the container with user namespace enabled. This flag conflicts with `--userns` and `--gidmap`.
Run the container in a new user namespace from the map with 'name' in the `/etc/subgid` file.
Copy link
Member

Choose a reason for hiding this comment

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

suggest "from the map" to "using the map"

Copy link
Member

Choose a reason for hiding this comment

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

ditto other instances.


The following example maps uids 0-2000 in the container to the uids 30000-31999 on the host and gids 0-2000 in the container to the gids 30000-31999 on the host.
Run the container in a new user namespace with the supplied mapping. This option conflicts with the --userns and --subgidname flags.
This option can be passed several times to map different ranges. If calling podman run as an unprivileged user, the user needs to have the right to use the mapping. See `man subuid`.
Copy link
Member

Choose a reason for hiding this comment

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

man subuid to subuid(5) ditto other spots for subuid and subgid

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.

Couple of nits, but very nice change overall. TYVM @najamelan !

Signed-off-by: Naja Melan <najamelan@autistici.org>
@najamelan
Copy link
Contributor Author

najamelan commented Aug 31, 2018

I made the suggested changes. There's still the question about what --userns does exactly. I had a look through the code, but it's not easy to figure out.

@rhatdan
Copy link
Member

rhatdan commented Aug 31, 2018

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Collaborator

📌 Commit 7d90862 has been approved by rhatdan

@najamelan
Copy link
Contributor Author

najamelan commented Aug 31, 2018

I really propose not merging this before resolving the other questions from the pull request descriptions. I propose:

  1. somebody clarifies what exactly --userns does
  2. I go through the docs for all other commands than podman run and make sure the documentation for these and similar options are clear and consistent everywhere.

@rhatdan
Copy link
Member

rhatdan commented Aug 31, 2018

@najamelan Lets do that in a different PR. We have a release later today. And getting these documentation fixes in now are good. Then we can continue to clean it up next week.

@najamelan
Copy link
Contributor Author

It's up to you, just know that possibly the documentation for --userns in this form might be incorrect in what it states, and nobody has clarified it.

@rh-atomic-bot
Copy link
Collaborator

⌛ Testing commit 7d90862 with merge e6ab690...

@rh-atomic-bot
Copy link
Collaborator

💔 Test failed - status-papr

@mheon
Copy link
Member

mheon commented Aug 31, 2018

I don't really understand why it's always the FAH28 VMs that blow up on Homu - it should all be running on the same cluster...

@rh-atomic-bot retry

@rh-atomic-bot
Copy link
Collaborator

⌛ Testing commit 7d90862 with merge de414c4...

rh-atomic-bot pushed a commit that referenced this pull request Aug 31, 2018
Signed-off-by: Naja Melan <najamelan@autistici.org>

Closes: #1380
Approved by: rhatdan
@rh-atomic-bot
Copy link
Collaborator

☀️ Test successful - status-papr
Approved by: rhatdan
Pushing de414c4 to master...

edsantiago added a commit to edsantiago/libpod that referenced this pull request Aug 30, 2022
Whew! This one started off identical everywhere, but the version
in podman-run got fixed in containers#1380, then again in containers#5192, with no
corresponding fixes to any of the other man pages.

I went with the podman-run version, with a small change in wording.

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 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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.

5 participants