mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 21:25:09 +00:00
e2e_node: use mktemp when building nsenter on trusty
There's a bit of a hack in place to insure nsenter is present on Ubuntu trusty, which doesn't otherwise include it. This downloads util-linux to a hard coded directory in /tmp which is a bad practice. Even though "this is just a test case" it should properly use mktemp. Signed-off-by: Tim Pepper <tpepper@vmware.com>
This commit is contained in:
@@ -57,8 +57,8 @@ cat /etc/*-release | grep "ID=ubuntu"
|
||||
if [ $? -eq 0 ]; then
|
||||
if ! which nsenter > /dev/null; then
|
||||
echo "Do not find nsenter. Install it."
|
||||
mkdir -p /tmp/nsenter-install
|
||||
cd /tmp/nsenter-install
|
||||
NSENTER_BUILD_DIR=$(mktemp -d /tmp/nsenter-build-XXXXXX)
|
||||
cd $NSENTER_BUILD_DIR
|
||||
curl https://www.kernel.org/pub/linux/utils/util-linux/v2.24/util-linux-2.24.tar.gz | tar -zxf-
|
||||
sudo apt-get update
|
||||
sudo apt-get --yes install make
|
||||
@@ -67,7 +67,7 @@ if [ $? -eq 0 ]; then
|
||||
./configure --without-ncurses
|
||||
make nsenter
|
||||
sudo cp nsenter /usr/local/bin
|
||||
rm -rf /tmp/nsenter-install
|
||||
rm -rf $NSENTER_BUILD_DIR
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Reference in New Issue
Block a user