From 2de8daf024d29f856ace307d22497d09c0ef2d47 Mon Sep 17 00:00:00 2001 From: Aaron Crickenberger Date: Tue, 7 Aug 2018 17:36:33 -0700 Subject: [PATCH] macOS and docker for mac don't play nicely with mktemp On macOS mktemp -d drops something in /var/folders, which isn't shared by default with Docker for Mac. Thus I can't run docker with that volume mounted to build binaries for test images. So instead, tell mktemp to use kubernetes/_tmp as its base, which is what I see some of the hack/verify-* scripts use. --- test/images/image-util.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/images/image-util.sh b/test/images/image-util.sh index 5ba5e1fc058..dcfd361963f 100755 --- a/test/images/image-util.sh +++ b/test/images/image-util.sh @@ -56,7 +56,10 @@ build() { # Create a temporary directory for every architecture and copy the image content # and build the image from temporary directory - temp_dir=$(mktemp -d) + mkdir -p ${KUBE_ROOT}/_tmp + temp_dir=$(mktemp -d ${KUBE_ROOT}/_tmp/test-images-build.XXXXXX) + kube::util::trap_add "rm -rf ${temp_dir}" EXIT + cp -r ${IMAGE}/* ${temp_dir} if [[ -f ${IMAGE}/Makefile ]]; then # make bin will take care of all the prerequisites needed