Skip to content

Commit 736baa5

Browse files
authored
Merge pull request kubernetes#73593 from danielqsj/etcd
fix shellcheck failure in etcd shell
2 parents d48eb30 + e698682 commit 736baa5

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

hack/.shellcheck_failures

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
./hack/jenkins/test-dockerized.sh
3636
./hack/jenkins/upload-to-gcs.sh
3737
./hack/jenkins/verify-dockerized.sh
38-
./hack/lib/etcd.sh
3938
./hack/lib/golang.sh
4039
./hack/lib/init.sh
4140
./hack/lib/logging.sh

hack/lib/etcd.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@ kube::etcd::validate() {
4141
fi
4242
if ${port_check_command} -nat | grep "LISTEN" | grep "[\.:]${ETCD_PORT:?}" >/dev/null 2>&1; then
4343
kube::log::usage "unable to start etcd as port ${ETCD_PORT} is in use. please stop the process listening on this port and retry."
44-
kube::log::usage "`netstat -nat | grep "[\.:]${ETCD_PORT:?} .*LISTEN"`"
44+
kube::log::usage "$(netstat -nat | grep "[\.:]${ETCD_PORT:?} .*LISTEN")"
4545
exit 1
4646
fi
4747

4848
# validate installed version is at least equal to minimum
4949
version=$(etcd --version | tail -n +1 | head -n 1 | cut -d " " -f 3)
50-
if [[ $(kube::etcd::version ${ETCD_VERSION}) -gt $(kube::etcd::version ${version}) ]]; then
50+
if [[ $(kube::etcd::version "${ETCD_VERSION}") -gt $(kube::etcd::version "${version}") ]]; then
5151
export PATH=${KUBE_ROOT}/third_party/etcd:${PATH}
5252
hash etcd
5353
echo "${PATH}"
5454
version=$(etcd --version | head -n 1 | cut -d " " -f 3)
55-
if [[ $(kube::etcd::version ${ETCD_VERSION}) -gt $(kube::etcd::version ${version}) ]]; then
55+
if [[ $(kube::etcd::version "${ETCD_VERSION}") -gt $(kube::etcd::version "${version}") ]]; then
5656
kube::log::usage "etcd version ${ETCD_VERSION} or greater required."
5757
kube::log::info "You can use 'hack/install-etcd.sh' to install a copy in third_party/."
5858
exit 1
@@ -76,7 +76,7 @@ kube::etcd::start() {
7676
ETCD_LOGFILE=${ETCD_LOGFILE:-"/dev/null"}
7777
fi
7878
kube::log::info "etcd --advertise-client-urls ${KUBE_INTEGRATION_ETCD_URL} --data-dir ${ETCD_DIR} --listen-client-urls http://${ETCD_HOST}:${ETCD_PORT} --debug > \"${ETCD_LOGFILE}\" 2>/dev/null"
79-
etcd --advertise-client-urls ${KUBE_INTEGRATION_ETCD_URL} --data-dir ${ETCD_DIR} --listen-client-urls ${KUBE_INTEGRATION_ETCD_URL} --debug 2> "${ETCD_LOGFILE}" >/dev/null &
79+
etcd --advertise-client-urls "${KUBE_INTEGRATION_ETCD_URL}" --data-dir "${ETCD_DIR}" --listen-client-urls "${KUBE_INTEGRATION_ETCD_URL}" --debug 2> "${ETCD_LOGFILE}" >/dev/null &
8080
ETCD_PID=$!
8181

8282
echo "Waiting for etcd to come up."
@@ -110,7 +110,7 @@ kube::etcd::install() {
110110
os=$(kube::util::host_os)
111111
arch=$(kube::util::host_arch)
112112

113-
cd "${KUBE_ROOT}/third_party"
113+
cd "${KUBE_ROOT}/third_party" || return 1
114114
if [[ $(readlink etcd) == etcd-v${ETCD_VERSION}-${os}-* ]]; then
115115
kube::log::info "etcd v${ETCD_VERSION} already installed at path:"
116116
kube::log::info "$(pwd)/$(readlink etcd)"

0 commit comments

Comments
 (0)