build-ui.sh: use kube::util::ensure-temp-dir instead of static path.

Using static paths for temporary files has been a security problem in
the past. Use kube::util::ensure-temp-dir to create a safe temporary
directory and place the temporary file there.
This commit is contained in:
Ismo Puustinen
2018-03-12 14:13:54 +02:00
parent 5d67222592
commit abc6fe6dbb

View File

@@ -30,7 +30,8 @@ if ! which go-bindata > /dev/null 2>&1 ; then
exit 1
fi
readonly TMP_DATAFILE="/tmp/datafile.go"
kube::util::ensure-temp-dir
readonly TMP_DATAFILE="${KUBE_TEMP}/datafile.go"
readonly SWAGGER_SRC="third_party/swagger-ui/..."
readonly SWAGGER_PKG="swagger"