mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-01 08:56:32 +00:00
Merge pull request #10149 from fidencio/topic/kata-manager-relax-opt-check
kata-manager: Only check files when tarball is not passed
This commit is contained in:
@@ -803,20 +803,23 @@ install_kata()
|
|||||||
local from_dir
|
local from_dir
|
||||||
from_dir=$(printf "%s/bin" "$kata_install_dir")
|
from_dir=$(printf "%s/bin" "$kata_install_dir")
|
||||||
|
|
||||||
info "Checking file '$file'"
|
|
||||||
|
|
||||||
# Since we're unpacking to the root directory, perform a sanity check
|
|
||||||
# on the archive first.
|
|
||||||
local unexpected
|
|
||||||
unexpected=$(tar -tf "${file}" |\
|
|
||||||
grep -Ev "^(\./$|\./opt/$|\.${kata_install_dir}/)" || true)
|
|
||||||
|
|
||||||
[ -n "$unexpected" ] && die "File '$file' contains unexpected paths: '$unexpected'"
|
|
||||||
|
|
||||||
if [ -n "$kata_tarball" ]
|
if [ -n "$kata_tarball" ]
|
||||||
then
|
then
|
||||||
info "Installing $project release from $file"
|
info "Installing $project release from $file"
|
||||||
else
|
else
|
||||||
|
# Only do the checking in case the tarball was not explicitly passed
|
||||||
|
# by the user. We have no control of what's passed and we cannot
|
||||||
|
# expect that all the files are going to be under /opt.
|
||||||
|
info "Checking file '$file'"
|
||||||
|
|
||||||
|
# Since we're unpacking to the root directory, perform a sanity check
|
||||||
|
# on the archive first.
|
||||||
|
local unexpected
|
||||||
|
unexpected=$(tar -tf "${file}" |\
|
||||||
|
grep -Ev "^(\./$|\./opt/$|\.${kata_install_dir}/)" || true)
|
||||||
|
|
||||||
|
[ -n "$unexpected" ] && die "File '$file' contains unexpected paths: '$unexpected'"
|
||||||
|
|
||||||
info "Installing $project release $version from $file"
|
info "Installing $project release $version from $file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user