diff --git a/build/common.sh b/build/common.sh index 7289801157..fa59175701 100755 --- a/build/common.sh +++ b/build/common.sh @@ -501,9 +501,11 @@ function kube::build::ensure_data_container() { # If the data container exists AND exited successfully, we can use it. # Otherwise nuke it and start over. local ret=0 - local code=$(docker inspect \ + local code=0 + + code=$(docker inspect \ -f '{{.State.ExitCode}}' \ - "${KUBE_DATA_CONTAINER_NAME}" 2>/dev/null || ret=$?) + "${KUBE_DATA_CONTAINER_NAME}" 2>/dev/null) || ret=$? if [[ "${ret}" == 0 && "${code}" != 0 ]]; then kube::build::destroy_container "${KUBE_DATA_CONTAINER_NAME}" ret=1