diff --git a/build/lib/release.sh b/build/lib/release.sh index 069c35613ce9c..6d23dc2033986 100644 --- a/build/lib/release.sh +++ b/build/lib/release.sh @@ -108,7 +108,7 @@ function kube::release::package_tarballs() { function kube::release::package_src_tarball() { local -r src_tarball="${RELEASE_TARS}/kubernetes-src.tar.gz" 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 else find "${KUBE_ROOT}" -mindepth 1 -maxdepth 1 \ @@ -140,7 +140,7 @@ function kube::release::package_client_tarballs() { mkdir -p "${release_stage}/client/bin" local client_bins=("${KUBE_CLIENT_BINARIES[@]}") - if [ "${platform%/*}" = 'windows' ]; then + if [[ "${platform%/*}" = 'windows' ]]; then client_bins=("${KUBE_CLIENT_BINARIES_WIN[@]}") fi @@ -176,7 +176,7 @@ function kube::release::package_node_tarballs() { mkdir -p "${release_stage}/node/bin" local node_bins=("${KUBE_NODE_BINARIES[@]}") - if [ "${platform%/*}" = 'windows' ]; then + if [[ "${platform%/*}" = 'windows' ]]; then node_bins=("${KUBE_NODE_BINARIES_WIN[@]}") fi # 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. local client_bins=("${KUBE_CLIENT_BINARIES[@]}") - if [ "${platform%/*}" = 'windows' ]; then + if [[ "${platform%/*}" = 'windows' ]]; then client_bins=("${KUBE_CLIENT_BINARIES_WIN[@]}") fi # 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. local client_bins client_bins=("${KUBE_CLIENT_BINARIES[@]}") - if [ "${platform%/*}" = 'windows' ]; then + if [[ "${platform%/*}" = 'windows' ]]; then client_bins=("${KUBE_CLIENT_BINARIES_WIN[@]}") fi # This fancy expression will expand to prepend a path @@ -310,7 +310,7 @@ function kube::release::build_hyperkube_image() { local hyperkube_tag 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" fi kube::log::status "Deleting hyperkube image ${hyperkube_tag}" @@ -328,7 +328,7 @@ function kube::release::build_conformance_image() { local conformance_tag 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" fi 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" # Docker tags cannot contain '+' 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" return 1 fi @@ -401,7 +401,7 @@ EOF # If we are building an official/alpha/beta release we want to keep # 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}" - 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}" "${DOCKER[@]}" rmi "${release_docker_image_tag}" 2>/dev/null || true "${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}" \; 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" - 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}/" fi 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" local test_bins=("${KUBE_TEST_BINARIES[@]}") - if [ "${platform%/*}" = 'windows' ]; then + if [[ "${platform%/*}" = 'windows' ]]; then test_bins=("${KUBE_TEST_BINARIES_WIN[@]}") fi # This fancy expression will expand to prepend a path