-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
rootless: allow single ID mappings #2604
rootless: allow single ID mappings #2604
Conversation
print an error if there is any failure pulling an image. Signed-off-by: Giuseppe Scrivano <[email protected]>
49018a3
to
3a1bc26
Compare
71bbfc8
to
360beae
Compare
@@ -237,46 +220,15 @@ func BecomeRootInUserNS() (bool, int, error) { | |||
return false, -1, errors.Errorf("cannot re-exec process") | |||
} | |||
|
|||
allowSingleIDMapping := os.Getenv("PODMAN_ALLOW_SINGLE_ID_MAPPING_IN_USERNS") != "" | |||
|
|||
var uids, gids []idtools.IDMap | |||
username := os.Getenv("USER") | |||
if username == "" { | |||
user, err := user.LookupId(fmt.Sprintf("%d", os.Getuid())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going back and forth so I'll throw it up for consideration. Any value to doing a logru.debugf here and after line 231 to show the error that was hit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that means the UID we are running with is not present in the users DB. I don't think it should matter, but I can add a Debugf if that can help
One question for cosideration, otherwise LGTM |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe, jamescassell 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 |
we were playing safe and not allowed any container to have less than 65536 mappings. There are a couple of reasons to change it: - it blocked libpod to work in an environment where newuidmap/newgidmap are not available, or not configured. - not allowed to use different partitions of subuids, where each user has less than 65536 ids available. Hopefully this change in containers/storage: containers/storage#303 will make error clearers if there are not enough IDs for the image that is being used. Closes: containers#1651 Signed-off-by: Giuseppe Scrivano <[email protected]>
360beae
to
af3e734
Compare
@jamescassell does the PR work for you? @TomSweeneyRedHat Pushed a new version with the Debugf statement |
LGTM |
/lgtm |
we were playing safe and not allowed any container to have less than 65536 mappings. There are a couple of reasons to change it:
it blocked libpod to work in an environment where newuidmap/newgidmap are not available, or not configured.
not allowed to use different partitions of subuids, where each user has less than 65536 ids available.
Hopefully this change in containers/storage:
containers/storage#303
will make error clearers if there are not enough IDs for the image that is being used.
Closes: #1651
Signed-off-by: Giuseppe Scrivano [email protected]