mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-29 13:24:42 +00:00
fix shellcheck failure in etcd shell
This commit is contained in:
parent
139a13d312
commit
c215966d22
@ -40,13 +40,11 @@
|
|||||||
./hack/godep-restore.sh
|
./hack/godep-restore.sh
|
||||||
./hack/godep-save.sh
|
./hack/godep-save.sh
|
||||||
./hack/grab-profiles.sh
|
./hack/grab-profiles.sh
|
||||||
./hack/install-etcd.sh
|
|
||||||
./hack/jenkins/benchmark-dockerized.sh
|
./hack/jenkins/benchmark-dockerized.sh
|
||||||
./hack/jenkins/build.sh
|
./hack/jenkins/build.sh
|
||||||
./hack/jenkins/test-dockerized.sh
|
./hack/jenkins/test-dockerized.sh
|
||||||
./hack/jenkins/upload-to-gcs.sh
|
./hack/jenkins/upload-to-gcs.sh
|
||||||
./hack/jenkins/verify-dockerized.sh
|
./hack/jenkins/verify-dockerized.sh
|
||||||
./hack/lib/etcd.sh
|
|
||||||
./hack/lib/golang.sh
|
./hack/lib/golang.sh
|
||||||
./hack/lib/init.sh
|
./hack/lib/init.sh
|
||||||
./hack/lib/logging.sh
|
./hack/lib/logging.sh
|
||||||
|
@ -21,7 +21,7 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||||
|
|
||||||
kube::etcd::install
|
kube::etcd::install
|
||||||
|
@ -16,6 +16,10 @@
|
|||||||
|
|
||||||
# A set of helpers for starting/running etcd for tests
|
# A set of helpers for starting/running etcd for tests
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
ETCD_VERSION=${ETCD_VERSION:-3.3.10}
|
ETCD_VERSION=${ETCD_VERSION:-3.3.10}
|
||||||
ETCD_HOST=${ETCD_HOST:-127.0.0.1}
|
ETCD_HOST=${ETCD_HOST:-127.0.0.1}
|
||||||
ETCD_PORT=${ETCD_PORT:-2379}
|
ETCD_PORT=${ETCD_PORT:-2379}
|
||||||
@ -41,18 +45,18 @@ kube::etcd::validate() {
|
|||||||
fi
|
fi
|
||||||
if ${port_check_command} -nat | grep "LISTEN" | grep "[\.:]${ETCD_PORT:?}" >/dev/null 2>&1; then
|
if ${port_check_command} -nat | grep "LISTEN" | grep "[\.:]${ETCD_PORT:?}" >/dev/null 2>&1; then
|
||||||
kube::log::usage "unable to start etcd as port ${ETCD_PORT} is in use. please stop the process listening on this port and retry."
|
kube::log::usage "unable to start etcd as port ${ETCD_PORT} is in use. please stop the process listening on this port and retry."
|
||||||
kube::log::usage "`netstat -nat | grep "[\.:]${ETCD_PORT:?} .*LISTEN"`"
|
kube::log::usage "$(netstat -nat | grep "[\.:]${ETCD_PORT:?} .*LISTEN")"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# validate installed version is at least equal to minimum
|
# validate installed version is at least equal to minimum
|
||||||
version=$(etcd --version | tail -n +1 | head -n 1 | cut -d " " -f 3)
|
version=$(etcd --version | tail -n +1 | head -n 1 | cut -d " " -f 3)
|
||||||
if [[ $(kube::etcd::version ${ETCD_VERSION}) -gt $(kube::etcd::version ${version}) ]]; then
|
if [[ $(kube::etcd::version "${ETCD_VERSION}") -gt $(kube::etcd::version "${version}") ]]; then
|
||||||
export PATH=${KUBE_ROOT}/third_party/etcd:${PATH}
|
export PATH=${KUBE_ROOT}/third_party/etcd:${PATH}
|
||||||
hash etcd
|
hash etcd
|
||||||
echo "${PATH}"
|
echo "${PATH}"
|
||||||
version=$(etcd --version | head -n 1 | cut -d " " -f 3)
|
version=$(etcd --version | head -n 1 | cut -d " " -f 3)
|
||||||
if [[ $(kube::etcd::version ${ETCD_VERSION}) -gt $(kube::etcd::version ${version}) ]]; then
|
if [[ $(kube::etcd::version "${ETCD_VERSION}") -gt $(kube::etcd::version "${version}") ]]; then
|
||||||
kube::log::usage "etcd version ${ETCD_VERSION} or greater required."
|
kube::log::usage "etcd version ${ETCD_VERSION} or greater required."
|
||||||
kube::log::info "You can use 'hack/install-etcd.sh' to install a copy in third_party/."
|
kube::log::info "You can use 'hack/install-etcd.sh' to install a copy in third_party/."
|
||||||
exit 1
|
exit 1
|
||||||
@ -76,7 +80,7 @@ kube::etcd::start() {
|
|||||||
ETCD_LOGFILE=${ETCD_LOGFILE:-"/dev/null"}
|
ETCD_LOGFILE=${ETCD_LOGFILE:-"/dev/null"}
|
||||||
fi
|
fi
|
||||||
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"
|
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"
|
||||||
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 &
|
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 &
|
||||||
ETCD_PID=$!
|
ETCD_PID=$!
|
||||||
|
|
||||||
echo "Waiting for etcd to come up."
|
echo "Waiting for etcd to come up."
|
||||||
|
Loading…
Reference in New Issue
Block a user