mirror of https://github.com/k3s-io/k3s
Merge pull request #63633 from misterikkit/hacktest
Automatic merge from submit-queue (batch tested with PRs 65247, 63633, 67425). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. test: allow etcd to run on other ports. running `make test-integration` with the `ETCD_PORT` option set should work. Numerous integration test expect the correct URL to be populated in the `KUBE_INTEGRATION_ETCD_URL` environment variable. **What this PR does / why we need it**: This makes the ETCD_PORT option work correctly. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: **Special notes for your reviewer**: I expect nobody is using the ETCD_PORT option, but I noticed that it is broken. **Release note**: ```release-note NONE ``` /sig testingpull/8/head
commit
bcd220d898
|
@ -19,6 +19,7 @@
|
|||
ETCD_VERSION=${ETCD_VERSION:-3.2.18}
|
||||
ETCD_HOST=${ETCD_HOST:-127.0.0.1}
|
||||
ETCD_PORT=${ETCD_PORT:-2379}
|
||||
export KUBE_INTEGRATION_ETCD_URL="http://${ETCD_HOST}:${ETCD_PORT}"
|
||||
|
||||
kube::etcd::validate() {
|
||||
# validate if in path
|
||||
|
@ -74,13 +75,13 @@ kube::etcd::start() {
|
|||
else
|
||||
ETCD_LOGFILE=${ETCD_LOGFILE:-"/dev/null"}
|
||||
fi
|
||||
kube::log::info "etcd --advertise-client-urls http://${ETCD_HOST}:${ETCD_PORT} --data-dir ${ETCD_DIR} --listen-client-urls http://${ETCD_HOST}:${ETCD_PORT} --debug > \"${ETCD_LOGFILE}\" 2>/dev/null"
|
||||
etcd --advertise-client-urls http://${ETCD_HOST}:${ETCD_PORT} --data-dir ${ETCD_DIR} --listen-client-urls http://${ETCD_HOST}:${ETCD_PORT} --debug 2> "${ETCD_LOGFILE}" >/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_PID=$!
|
||||
|
||||
echo "Waiting for etcd to come up."
|
||||
kube::util::wait_for_url "http://${ETCD_HOST}:${ETCD_PORT}/v2/machines" "etcd: " 0.25 80
|
||||
curl -fs -X PUT "http://${ETCD_HOST}:${ETCD_PORT}/v2/keys/_test"
|
||||
kube::util::wait_for_url "${KUBE_INTEGRATION_ETCD_URL}/v2/machines" "etcd: " 0.25 80
|
||||
curl -fs -X PUT "${KUBE_INTEGRATION_ETCD_URL}/v2/keys/_test"
|
||||
}
|
||||
|
||||
kube::etcd::stop() {
|
||||
|
|
Loading…
Reference in New Issue