mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-09-05 23:27:48 +00:00
Merge pull request #9835 from ntkme/check-userns-support
[NO TESTS NEEDED] Fix for kernel without CONFIG_USER_NS
This commit is contained in:
commit
5afcaeeaef
1 changed files with 9 additions and 3 deletions
|
|
@ -607,10 +607,16 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) {
|
|||
|
||||
availableUIDs, availableGIDs, err := rootless.GetAvailableIDMaps()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
if os.IsNotExist(err) {
|
||||
// The kernel-provided files only exist if user namespaces are supported
|
||||
logrus.Debugf("user or group ID mappings not available: %s", err)
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
g.Config.Linux.UIDMappings = rootless.MaybeSplitMappings(g.Config.Linux.UIDMappings, availableUIDs)
|
||||
g.Config.Linux.GIDMappings = rootless.MaybeSplitMappings(g.Config.Linux.GIDMappings, availableGIDs)
|
||||
}
|
||||
g.Config.Linux.UIDMappings = rootless.MaybeSplitMappings(g.Config.Linux.UIDMappings, availableUIDs)
|
||||
g.Config.Linux.GIDMappings = rootless.MaybeSplitMappings(g.Config.Linux.GIDMappings, availableGIDs)
|
||||
|
||||
// Hostname handling:
|
||||
// If we have a UTS namespace, set Hostname in the OCI spec.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue