Skip to content

Instantly share code, notes, and snippets.

@stevekuznetsov
Created March 15, 2016 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevekuznetsov/a14e6c7e63a3908a14ff to your computer and use it in GitHub Desktop.
Save stevekuznetsov/a14e6c7e63a3908a14ff to your computer and use it in GitHub Desktop.
shellcheck on util
In hack/util.sh line 75:
--write-config=${SERVER_CONFIG_DIR} \
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 87:
os::util::sed "s/:4001$/:${ETCD_PORT}/g" ${SERVER_CONFIG_DIR}/master/master-config.yaml
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 88:
os::util::sed "s/:7001$/:${ETCD_PEER_PORT}/g" ${SERVER_CONFIG_DIR}/master/master-config.yaml
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 93:
export CLUSTER_ADMIN_CONTEXT=$(oc config view --config=${ADMIN_KUBECONFIG} --flatten -o template --template='{{index . "current-context"}}')
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 126:
echo "[INFO] `openshift version`"
^-- SC2006: Use $(..) instead of deprecated `..`
In hack/util.sh line 134:
mkdir -p ${LOG_DIR}
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 137:
ps -ef | grep openshift
^-- SC2009: Consider using pgrep instead of grepping ps output.
In hack/util.sh line 140:
--master-config=${MASTER_CONFIG_DIR}/master-config.yaml \
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 141:
--node-config=${NODE_CONFIG_DIR}/node-config.yaml \
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 179:
echo "[INFO] `openshift version`"
^-- SC2006: Use $(..) instead of deprecated `..`
In hack/util.sh line 186:
mkdir -p ${LOG_DIR}
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 189:
ps -ef | grep openshift
^-- SC2009: Consider using pgrep instead of grepping ps output.
In hack/util.sh line 192:
--config=${MASTER_CONFIG_DIR}/master-config.yaml \
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 231:
echo "++ Retrying until success or timeout: ${@}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
In hack/util.sh line 232:
while [ 1 ]; do
^-- SC2078: This expression is constant. Did you forget a $ somewhere?
In hack/util.sh line 264:
expire=$(($(time_now) + $max_wait))
^-- SC2004: $ on variables in (( )) is unnecessary.
In hack/util.sh line 267:
eval $cmd
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 271:
echo "[INFO] Success running command: '$cmd' after $(($ENDTIME - $STARTTIME)) seconds"
^-- SC2004: $ on variables in (( )) is unnecessary.
^-- SC2004: $ on variables in (( )) is unnecessary.
In hack/util.sh line 278:
eval $fail
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 304:
expire=$(($(time_now) + $max_wait))
^-- SC2004: $ on variables in (( )) is unnecessary.
In hack/util.sh line 307:
out=$(curl --max-time 2 -fs $url 2>/dev/null)
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 310:
echo ${prefix}${out}
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 312:
echo "[INFO] Success accessing '$url' after $(($ENDTIME - $STARTTIME)) seconds"
^-- SC2004: $ on variables in (( )) is unnecessary.
^-- SC2004: $ on variables in (( )) is unnecessary.
In hack/util.sh line 331:
for i in $(seq 1 $times); do
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 335:
sleep $wait
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 354:
set_curl_args $wait $times
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 358:
for i in $(seq 1 $times); do
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 365:
sleep $wait
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 368:
echo $(${cmd})
^-- SC2046: Quote this to prevent word splitting.
^-- SC2005: Useless echo? Instead of 'echo $(cmd)', just use 'cmd'.
In hack/util.sh line 390:
if [[ `curl -V` == *"SecureTransport"* ]]; then
^-- SC2006: Use $(..) instead of deprecated `..`
In hack/util.sh line 396:
wait_for_file "${CURL_CERT}" $wait $times
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 397:
wait_for_file "${CURL_KEY}" $wait $times
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 420:
for i in $(seq 1 $times); do
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 421:
response=`curl $url`
^-- SC2006: Use $(..) instead of deprecated `..`
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 422:
echo $response | grep -q "$expected_response"
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 428:
sleep $wait
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 446:
${sudo} rm -rf ${BASETMPDIR} &>/dev/null
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 449:
findmnt -lo TARGET | grep ${BASETMPDIR} | xargs -r ${sudo} umount
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 450:
${sudo} rm -rf ${BASETMPDIR}
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 453:
mkdir -p ${BASETMPDIR} ${LOG_DIR} ${ARTIFACT_DIR} ${FAKE_HOME_DIR} ${VOLUME_DIR}
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 464:
for i in ${pids[@]-}; do
^-- SC2068: Double quote array expansions, otherwise they're like $* and break on spaces.
In hack/util.sh line 465:
pgrep -P "${i}" | xargs $sudo kill &> /dev/null
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 473:
echo $(date +%s000)
^-- SC2046: Quote this to prevent word splitting.
^-- SC2005: Useless echo? Instead of 'echo $(cmd)', just use 'cmd'.
In hack/util.sh line 483:
mkdir -p ${LOG_DIR}
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 487:
container_name=$(docker inspect -f "{{.Name}}" $container)
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 491:
pod_name=$(echo $container_name | awk 'BEGIN { FS="[_.]+" }; { print $4 }')
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 492:
container_name=${pod_name}-$(echo $container_name | awk 'BEGIN { FS="[_.]+" }; { print $2 }')
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 539:
oc login -u system:admin -n default --config=${ADMIN_KUBECONFIG}
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 540:
oc export all --all-namespaces --raw -o json --config=${ADMIN_KUBECONFIG} > ${LOG_DIR}/export_all.json
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 545:
curl -s ${clientcert_args} -L "${API_SCHEME}://${API_HOST}:${ETCD_PORT}/v2/keys/?recursive=true" > "${ARTIFACT_DIR}/etcd_dump.json"
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 574:
GITCONFIG_DIR=$(mktemp -d ${BASETMPDIR}/test-gitconfig.XXXX)
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 575:
touch ${GITCONFIG_DIR}/.gitconfig
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 576:
git config --file ${GITCONFIG_DIR}/.gitconfig user.name ${USERNAME}
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 577:
git config --file ${GITCONFIG_DIR}/.gitconfig user.token ${PASSWORD}
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 578:
echo ${GITCONFIG_DIR}/.gitconfig
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 583:
FILE_DIR=$(mktemp -d ${BASETMPDIR}/test-file.XXXX)
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 584:
touch ${FILE_DIR}/${1}
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 585:
echo ${FILE_DIR}/${1}
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 596:
oadm ca create-server-cert --signer-cert=${MASTER_CONFIG_DIR}/ca.crt \
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 597:
--signer-key=${MASTER_CONFIG_DIR}/ca.key \
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 598:
--signer-serial=${MASTER_CONFIG_DIR}/ca.serial.txt \
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 600:
--cert=${MASTER_CONFIG_DIR}/router.crt --key=${MASTER_CONFIG_DIR}/router.key
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 601:
cat ${MASTER_CONFIG_DIR}/router.crt ${MASTER_CONFIG_DIR}/router.key \
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 602:
${MASTER_CONFIG_DIR}/ca.crt > ${MASTER_CONFIG_DIR}/router.pem
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 605:
openshift admin router --create --credentials="${MASTER_CONFIG_DIR}/openshift-router.kubeconfig" --config="${ADMIN_KUBECONFIG}" --images="${USE_IMAGES}" --service-account=router ${ROUTER_DEFAULT_CERT-}
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 624:
wait_for_command '[[ "$(oc get endpoints docker-registry --output-version=v1 --template="{{ if .subsets }}{{ len .subsets }}{{ else }}0{{ end }}" --config=${ADMIN_KUBECONFIG} || echo "0")" != "0" ]]' $((5*TIME_MIN))
^-- SC2016: Expressions don't expand in single quotes, use double quotes for that.
In hack/util.sh line 633:
BUILD_ID=`oc get -n $1 builds --output-version=v1 --template="{{with index .items 0}}{{.metadata.name}}{{end}}"`
^-- SC2006: Use $(..) instead of deprecated `..`
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 642:
BUILD_ID=`oc get -n $1 builds --output-version=v1 --template="{{with index .items 0}}{{.metadata.name}}{{end}}"`
^-- SC2006: Use $(..) instead of deprecated `..`
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 646:
oc build-logs -n $1 $BUILD_ID > $LOG_DIR/$1build.log
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 680:
local err="${PIPESTATUS[@]}"
^-- SC2124: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.
In hack/util.sh line 711:
for ((i=1 ; i <= ${#FUNCNAME[@]} - $stack_skip ; i++))
^-- SC2004: $ on variables in (( )) is unnecessary.
In hack/util.sh line 728:
local message="${1:-}"
^-- SC2034: message appears unused. Verify it or export it.
In hack/util.sh line 748:
local severity=$2
^-- SC2034: severity appears unused. Verify it or export it.
In hack/util.sh line 796:
base64 -D $@
^-- SC2068: Double quote array expansions, otherwise they're like $* and break on spaces.
In hack/util.sh line 798:
base64 -d $@
^-- SC2068: Double quote array expansions, otherwise they're like $* and break on spaces.
In hack/util.sh line 807:
res=$(eval oc get $object -o go-template=\"$request\")
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment