New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assorted small shell script fixes #113190
Changes from all commits
8f6c631
94c0ec3
103e6cd
f72938f
95d08c5
4c7189f
68a4ced
49354dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2631,7 +2631,7 @@ function delete-subnetworks() { | |
# This value should be kept in sync with number of regions. | ||
local parallelism=9 | ||
gcloud compute networks subnets list --network="${NETWORK}" --project "${NETWORK_PROJECT}" --format='value(region.basename())' | \ | ||
xargs -i -P ${parallelism} gcloud --quiet compute networks subnets delete "${NETWORK}" --project "${NETWORK_PROJECT}" --region="{}" || true | ||
xargs -I {} -P ${parallelism} gcloud --quiet compute networks subnets delete "${NETWORK}" --project "${NETWORK_PROJECT}" --region="{}" || true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does the same thing, just in a POSIX form. |
||
elif [[ "${CREATE_CUSTOM_NETWORK:-}" == "true" ]]; then | ||
echo "Deleting custom subnet..." | ||
gcloud --quiet compute networks subnets delete "${SUBNETWORK}" --project "${NETWORK_PROJECT}" --region="${REGION}" || true | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -603,11 +603,9 @@ function kube::util::list_staging_repos() { | |
|
||
# Determines if docker can be run, failures may simply require that the user be added to the docker group. | ||
function kube::util::ensure_docker_daemon_connectivity { | ||
IFS=" " read -ra DOCKER <<< "${DOCKER_OPTS}" | ||
# Expand ${DOCKER[@]} only if it's not unset. This is to work around | ||
# Bash 3 issue with unbound variable. | ||
DOCKER=(docker ${DOCKER[@]:+"${DOCKER[@]}"}) | ||
if ! "${DOCKER[@]}" info > /dev/null 2>&1 ; then | ||
DOCKER_OPTS=${DOCKER_OPTS:-""} | ||
IFS=" " read -ra docker_opts <<< "${DOCKER_OPTS}" | ||
if ! docker "${docker_opts[@]:+"${docker_opts[@]}"}" info > /dev/null 2>&1 ; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be functionally equivalent, without assigning The previous version was a bit strange and shellcheck was understandably not happy about mixing this as a string or an array in scripts that source util.sh. |
||
cat <<'EOF' >&2 | ||
Can't connect to 'docker' daemon. please fix and retry. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file has a LOT of
readonly FOO=...
.We only need to alter those when they do complex assignments that may have a return value.
Lines like
readonly KUBE_BUILD_IMAGE_REPO=kube-build
we do not need to and it's not clearly worth the diff to change all of these, the linter should catch when it needs to be done (though, it clearly got smarter about this between v0.7.1 and v0.8.0).