summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@redhat.com>2022-05-12 13:38:08 +0200
committerValentin Rothberg <vrothberg@redhat.com>2022-05-13 15:41:28 +0200
commitc45d51899a8190bd3797cdee71b74b912a634c71 (patch)
treea656d1859b4a92f7073772d52ba1c7b1dae61f79 /pkg/specgen/generate
parent9cf38a0afbb2619b6eeacce7fade451b38e5bab6 (diff)
downloadpodman-c45d51899a8190bd3797cdee71b74b912a634c71.tar.gz
podman-c45d51899a8190bd3797cdee71b74b912a634c71.tar.bz2
podman-c45d51899a8190bd3797cdee71b74b912a634c71.zip
[BZ #2083997] pod: build pause image in custom user NS
Use the host UID and host GID mapping when building the local pause image for a Pod with a custom mapping. Otherwise, the mappings are off and the build fails. Propagating the mapping to the build container is not needed since the pause image ships merely a copied `catatonit` from the host. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2083997 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Diffstat (limited to 'pkg/specgen/generate')
-rw-r--r--pkg/specgen/generate/pause_image.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/specgen/generate/pause_image.go b/pkg/specgen/generate/pause_image.go
index 4aba230a3..ddf35f230 100644
--- a/pkg/specgen/generate/pause_image.go
+++ b/pkg/specgen/generate/pause_image.go
@@ -80,6 +80,12 @@ ENTRYPOINT ["/catatonit", "-P"]`, catatonitPath)
Quiet: true,
IgnoreFile: "/dev/null", // makes sure to not read a local .ignorefile (see #13529)
IIDFile: "/dev/null", // prevents Buildah from writing the ID on stdout
+ IDMappingOptions: &buildahDefine.IDMappingOptions{
+ // Use the host UID/GID mappings for the build to avoid issues when
+ // running with a custom mapping (BZ #2083997).
+ HostUIDMapping: true,
+ HostGIDMapping: true,
+ },
}
if _, _, err := rt.Build(context.Background(), buildOptions, tmpF.Name()); err != nil {
return "", err