Re-adding the [[ as per review comment request

Change-Id: I4a2fa687e6ef5c4ebf5c5624a730c32f23b7b134
Signed-off-by: Joakim Roubert <joakimr@axis.com>
This commit is contained in:
Joakim Roubert 2020-02-06 08:26:32 +01:00
parent b1d027742b
commit e05f8e6991

View File

@ -108,7 +108,7 @@ function kube::release::package_tarballs() {
function kube::release::package_src_tarball() { function kube::release::package_src_tarball() {
local -r src_tarball="${RELEASE_TARS}/kubernetes-src.tar.gz" local -r src_tarball="${RELEASE_TARS}/kubernetes-src.tar.gz"
kube::log::status "Building tarball: src" kube::log::status "Building tarball: src"
if [ "${KUBE_GIT_TREE_STATE-}" = 'clean' ]; then if [[ "${KUBE_GIT_TREE_STATE-}" = 'clean' ]]; then
git archive -o "${src_tarball}" HEAD git archive -o "${src_tarball}" HEAD
else else
find "${KUBE_ROOT}" -mindepth 1 -maxdepth 1 \ find "${KUBE_ROOT}" -mindepth 1 -maxdepth 1 \
@ -140,7 +140,7 @@ function kube::release::package_client_tarballs() {
mkdir -p "${release_stage}/client/bin" mkdir -p "${release_stage}/client/bin"
local client_bins=("${KUBE_CLIENT_BINARIES[@]}") local client_bins=("${KUBE_CLIENT_BINARIES[@]}")
if [ "${platform%/*}" = 'windows' ]; then if [[ "${platform%/*}" = 'windows' ]]; then
client_bins=("${KUBE_CLIENT_BINARIES_WIN[@]}") client_bins=("${KUBE_CLIENT_BINARIES_WIN[@]}")
fi fi
@ -176,7 +176,7 @@ function kube::release::package_node_tarballs() {
mkdir -p "${release_stage}/node/bin" mkdir -p "${release_stage}/node/bin"
local node_bins=("${KUBE_NODE_BINARIES[@]}") local node_bins=("${KUBE_NODE_BINARIES[@]}")
if [ "${platform%/*}" = 'windows' ]; then if [[ "${platform%/*}" = 'windows' ]]; then
node_bins=("${KUBE_NODE_BINARIES_WIN[@]}") node_bins=("${KUBE_NODE_BINARIES_WIN[@]}")
fi fi
# This fancy expression will expand to prepend a path # This fancy expression will expand to prepend a path
@ -190,7 +190,7 @@ function kube::release::package_node_tarballs() {
# Include the client binaries here too as they are useful debugging tools. # Include the client binaries here too as they are useful debugging tools.
local client_bins=("${KUBE_CLIENT_BINARIES[@]}") local client_bins=("${KUBE_CLIENT_BINARIES[@]}")
if [ "${platform%/*}" = 'windows' ]; then if [[ "${platform%/*}" = 'windows' ]]; then
client_bins=("${KUBE_CLIENT_BINARIES_WIN[@]}") client_bins=("${KUBE_CLIENT_BINARIES_WIN[@]}")
fi fi
# This fancy expression will expand to prepend a path # This fancy expression will expand to prepend a path
@ -262,7 +262,7 @@ function kube::release::package_server_tarballs() {
# Include the client binaries here too as they are useful debugging tools. # Include the client binaries here too as they are useful debugging tools.
local client_bins local client_bins
client_bins=("${KUBE_CLIENT_BINARIES[@]}") client_bins=("${KUBE_CLIENT_BINARIES[@]}")
if [ "${platform%/*}" = 'windows' ]; then if [[ "${platform%/*}" = 'windows' ]]; then
client_bins=("${KUBE_CLIENT_BINARIES_WIN[@]}") client_bins=("${KUBE_CLIENT_BINARIES_WIN[@]}")
fi fi
# This fancy expression will expand to prepend a path # This fancy expression will expand to prepend a path
@ -310,7 +310,7 @@ function kube::release::build_hyperkube_image() {
local hyperkube_tag local hyperkube_tag
hyperkube_tag="${registry}/hyperkube-${arch}:${version}" hyperkube_tag="${registry}/hyperkube-${arch}:${version}"
if [ -n "${save_dir}" ]; then if [[ -n "${save_dir}" ]]; then
"${DOCKER[@]}" save "${hyperkube_tag}" > "${save_dir}/hyperkube-${arch}.tar" "${DOCKER[@]}" save "${hyperkube_tag}" > "${save_dir}/hyperkube-${arch}.tar"
fi fi
kube::log::status "Deleting hyperkube image ${hyperkube_tag}" kube::log::status "Deleting hyperkube image ${hyperkube_tag}"
@ -328,7 +328,7 @@ function kube::release::build_conformance_image() {
local conformance_tag local conformance_tag
conformance_tag="${registry}/conformance-${arch}:${version}" conformance_tag="${registry}/conformance-${arch}:${version}"
if [ -n "${save_dir}" ]; then if [[ -n "${save_dir}" ]]; then
"${DOCKER[@]}" save "${conformance_tag}" > "${save_dir}/conformance-${arch}.tar" "${DOCKER[@]}" save "${conformance_tag}" > "${save_dir}/conformance-${arch}.tar"
fi fi
kube::log::status "Deleting conformance image ${conformance_tag}" kube::log::status "Deleting conformance image ${conformance_tag}"
@ -358,7 +358,7 @@ function kube::release::create_docker_images_for_server() {
local -r docker_registry="k8s.gcr.io" local -r docker_registry="k8s.gcr.io"
# Docker tags cannot contain '+' # Docker tags cannot contain '+'
local docker_tag="${KUBE_GIT_VERSION/+/_}" local docker_tag="${KUBE_GIT_VERSION/+/_}"
if [ -z "${docker_tag}" ]; then if [[ -z "${docker_tag}" ]]; then
kube::log::error "git version information missing; cannot create Docker tag" kube::log::error "git version information missing; cannot create Docker tag"
return 1 return 1
fi fi
@ -401,7 +401,7 @@ EOF
# If we are building an official/alpha/beta release we want to keep # If we are building an official/alpha/beta release we want to keep
# docker images and tag them appropriately. # docker images and tag them appropriately.
local -r release_docker_image_tag="${KUBE_DOCKER_REGISTRY-$docker_registry}/${binary_name}-${arch}:${KUBE_DOCKER_IMAGE_TAG-$docker_tag}" local -r release_docker_image_tag="${KUBE_DOCKER_REGISTRY-$docker_registry}/${binary_name}-${arch}:${KUBE_DOCKER_IMAGE_TAG-$docker_tag}"
if [ "${release_docker_image_tag}" != "${docker_image_tag}" ]; then if [[ "${release_docker_image_tag}" != "${docker_image_tag}" ]]; then
kube::log::status "Tagging docker image ${docker_image_tag} as ${release_docker_image_tag}" kube::log::status "Tagging docker image ${docker_image_tag} as ${release_docker_image_tag}"
"${DOCKER[@]}" rmi "${release_docker_image_tag}" 2>/dev/null || true "${DOCKER[@]}" rmi "${release_docker_image_tag}" 2>/dev/null || true
"${DOCKER[@]}" tag "${docker_image_tag}" "${release_docker_image_tag}" 2>/dev/null "${DOCKER[@]}" tag "${docker_image_tag}" "${release_docker_image_tag}" 2>/dev/null
@ -456,7 +456,7 @@ function kube::release::package_kube_manifests_tarball() {
find "${src_dir}" -name 'internal-*' -exec cp {} "${dst_dir}" \; find "${src_dir}" -name 'internal-*' -exec cp {} "${dst_dir}" \;
cp "${KUBE_ROOT}/cluster/gce/gci/configure-helper.sh" "${dst_dir}/gci-configure-helper.sh" cp "${KUBE_ROOT}/cluster/gce/gci/configure-helper.sh" "${dst_dir}/gci-configure-helper.sh"
cp "${KUBE_ROOT}/cluster/gce/gci/configure-kubeapiserver.sh" "${dst_dir}/configure-kubeapiserver.sh" cp "${KUBE_ROOT}/cluster/gce/gci/configure-kubeapiserver.sh" "${dst_dir}/configure-kubeapiserver.sh"
if [ -e "${KUBE_ROOT}/cluster/gce/gci/gke-internal-configure-helper.sh" ]; then if [[ -e "${KUBE_ROOT}/cluster/gce/gci/gke-internal-configure-helper.sh" ]]; then
cp "${KUBE_ROOT}/cluster/gce/gci/gke-internal-configure-helper.sh" "${dst_dir}/" cp "${KUBE_ROOT}/cluster/gce/gci/gke-internal-configure-helper.sh" "${dst_dir}/"
fi fi
cp "${KUBE_ROOT}/cluster/gce/gci/health-monitor.sh" "${dst_dir}/health-monitor.sh" cp "${KUBE_ROOT}/cluster/gce/gci/health-monitor.sh" "${dst_dir}/health-monitor.sh"
@ -495,7 +495,7 @@ function kube::release::package_test_platform_tarballs() {
mkdir -p "${release_stage}/test/bin" mkdir -p "${release_stage}/test/bin"
local test_bins=("${KUBE_TEST_BINARIES[@]}") local test_bins=("${KUBE_TEST_BINARIES[@]}")
if [ "${platform%/*}" = 'windows' ]; then if [[ "${platform%/*}" = 'windows' ]]; then
test_bins=("${KUBE_TEST_BINARIES_WIN[@]}") test_bins=("${KUBE_TEST_BINARIES_WIN[@]}")
fi fi
# This fancy expression will expand to prepend a path # This fancy expression will expand to prepend a path