Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/specgen/generate/pod_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,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
Expand Down
13 changes: 13 additions & 0 deletions test/system/170-run-userns.bats
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ function _require_crun() {
is "$output" ".*457" "Check group leaked into container"
}

@test "rootful pod with custom ID mapping" {
skip_if_rootless "does not work rootless - rootful feature"
skip_if_remote "remote --uidmap is broken (see #14233)"
random_pod_name=$(random_string 30)
run_podman pod create --uidmap 0:200000:5000 --name=$random_pod_name
Copy link
Member

@edsantiago edsantiago May 18, 2022

Choose a reason for hiding this comment

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

There is no test here. This test passes on main, which means you're not actually testing anything. Could you please add something that actually tests your new functionality (and which fails when run against main)? And can you add a comment describing something like "prior to #14280 this would fail with blah-blah-error" ?

[EDIT: what I mean is, it isn't clear if it's the "pod create" that you think would fail, or the "start", or if you accidentally a different step]

[EDIT 2: Sigh, never mind, I just noticed the v4.1. Test fails on v4.1 with

Error: error starting container e6696ef28b7428ab9009ff6c76c1977e0468ba5195e4d21e884e5306b7541965: crun: executable file `/catatonit` not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found

I would still appreciate a comment indicating that it's the start that would fail without this PR]

run_podman pod start $random_pod_name

# Remove the pod and the pause image
run_podman pod rm $random_pod_name
run_podman version --format "{{.Server.Version}}-{{.Server.Built}}"
run_podman rmi -f localhost/podman-pause:$output
Copy link
Member

Choose a reason for hiding this comment

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

Can't you just do rmi -f $(pause_image) ?

}

@test "podman --remote --group-add keep-groups " {
if is_remote; then
run_podman 125 run --rm --group-add keep-groups $IMAGE id
Expand Down