make more of the shell pass lints

This commit is contained in:
xichengliudui
2019-02-18 00:42:46 -05:00
parent 07a5488b2a
commit fd044c5770
3 changed files with 11 additions and 13 deletions

View File

@@ -18,16 +18,16 @@
PROJECT=${PROJECT:-kubernetes-jenkins}
REGION=${REGION:-us-central1}
LIST=$(gcloud --project=${PROJECT} compute target-pools list --format='value(name)')
LIST=$(gcloud --project="${PROJECT}" compute target-pools list --format='value(name)')
result=0
for x in ${LIST}; do
if ! gcloud compute --project=${PROJECT} target-pools get-health "${x}" --region=${REGION} 2>/dev/null >/dev/null; then
if ! gcloud compute --project="${PROJECT}" target-pools get-health "${x}" --region="${REGION}" 2>/dev/null >/dev/null; then
echo DELETING "${x}"
gcloud compute --project=${PROJECT} firewall-rules delete "k8s-fw-${x}" -q
gcloud compute --project=${PROJECT} forwarding-rules delete "${x}" --region=${REGION} -q
gcloud compute --project=${PROJECT} addresses delete "${x}" --region=${REGION} -q
gcloud compute --project=${PROJECT} target-pools delete "${x}" --region=${REGION} -q
gcloud compute --project="${PROJECT}" firewall-rules delete "k8s-fw-${x}" -q
gcloud compute --project="${PROJECT}" forwarding-rules delete "${x}" --region="${REGION}" -q
gcloud compute --project="${PROJECT}" addresses delete "${x}" --region="${REGION}" -q
gcloud compute --project="${PROJECT}" target-pools delete "${x}" --region="${REGION}" -q
result=1
fi
done

View File

@@ -17,14 +17,14 @@
echo "Removing empty directories from etcd..."
cleanup_empty_dirs () {
if [ "$(${ETCDCTL} ls $1)" ]; then
for SUBDIR in $(${ETCDCTL} ls -p $1 | grep "/$")
if [ "$("${ETCDCTL}" ls "${1}")" ]; then
for SUBDIR in $("${ETCDCTL}" ls -p "${1}" | grep "/$")
do
cleanup_empty_dirs ${SUBDIR}
cleanup_empty_dirs "${SUBDIR}"
done
else
echo "Removing empty key $1 ..."
${ETCDCTL} rmdir $1
"${ETCDCTL}" rmdir "${1}"
fi
}
@@ -33,5 +33,5 @@ do
echo "Starting cleanup..."
cleanup_empty_dirs "/registry"
echo "Done with cleanup."
sleep ${SLEEP_SECOND}
sleep "${SLEEP_SECOND}"
done