mirror of
https://github.com/containers/podman.git
synced 2025-05-21 00:56:36 +08:00
podman image scp never enter podman user NS
Podman image scp should never enter the Podman UserNS unless it needs to. This allows for a sudo exec.Command to transfer images to and from rootful storage. If this command is run using sudo, the simple sudo podman save/load does not work, machinectl/su is necessary here. This modification allows for both rootful and rootless transfers, and an overall change of scp to be more of a wrapper function for different load and save calls as well as the ssh component Signed-off-by: cdoern <cdoern@redhat.com>
This commit is contained in:
@ -318,6 +318,10 @@ function wait_for_port() {
|
||||
# BEGIN miscellaneous tools
|
||||
|
||||
# Shortcuts for common needs:
|
||||
function is_ubuntu() {
|
||||
grep -qiw ubuntu /etc/os-release
|
||||
}
|
||||
|
||||
function is_rootless() {
|
||||
[ "$(id -u)" -ne 0 ]
|
||||
}
|
||||
@ -449,6 +453,16 @@ function skip_if_journald_unavailable {
|
||||
fi
|
||||
}
|
||||
|
||||
function skip_if_root_ubuntu {
|
||||
if is_ubuntu; then
|
||||
if ! is_remote; then
|
||||
if ! is_rootless; then
|
||||
skip "Cannot run this test on rootful ubuntu, usually due to user errors"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
#########
|
||||
# die # Abort with helpful message
|
||||
#########
|
||||
|
Reference in New Issue
Block a user