mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 03:57:41 +00:00
Merge pull request #122470 from thockin/fix_openapi_chdir
Fix update-openapi-spec to not change caller CWD
This commit is contained in:
commit
f55d18a1cf
@ -144,6 +144,13 @@ kube::etcd::cleanup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
kube::etcd::install() {
|
kube::etcd::install() {
|
||||||
|
# Make sure that we will abort if the inner shell fails.
|
||||||
|
set -o errexit
|
||||||
|
set -o pipefail
|
||||||
|
set -o nounset
|
||||||
|
|
||||||
|
# We change directories below, so this subshell is needed.
|
||||||
|
(
|
||||||
local os
|
local os
|
||||||
local arch
|
local arch
|
||||||
|
|
||||||
@ -152,12 +159,8 @@ kube::etcd::install() {
|
|||||||
|
|
||||||
cd "${KUBE_ROOT}/third_party" || return 1
|
cd "${KUBE_ROOT}/third_party" || return 1
|
||||||
if [[ $(readlink etcd) == etcd-v${ETCD_VERSION}-${os}-* ]]; then
|
if [[ $(readlink etcd) == etcd-v${ETCD_VERSION}-${os}-* ]]; then
|
||||||
kube::log::info "etcd v${ETCD_VERSION} already installed. To use:"
|
V=3 kube::log::info "etcd v${ETCD_VERSION} is already installed"
|
||||||
kube::log::info "export PATH=\"$(pwd)/etcd:\${PATH}\""
|
return 0 # already installed
|
||||||
# export into current process
|
|
||||||
PATH="$(pwd)/etcd:${PATH}"
|
|
||||||
export PATH
|
|
||||||
return #already installed
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${os} == "darwin" ]]; then
|
if [[ ${os} == "darwin" ]]; then
|
||||||
@ -176,10 +179,14 @@ kube::etcd::install() {
|
|||||||
rm "${download_file}"
|
rm "${download_file}"
|
||||||
else
|
else
|
||||||
kube::log::info "${os} is NOT supported."
|
kube::log::info "${os} is NOT supported."
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
kube::log::info "etcd v${ETCD_VERSION} installed. To use:"
|
V=4 kube::log::info "installed etcd v${ETCD_VERSION}"
|
||||||
kube::log::info "export PATH=\"$(pwd)/etcd:\${PATH}\""
|
return 0 # newly installed
|
||||||
# export into current process
|
)
|
||||||
PATH="$(pwd)/etcd:${PATH}"
|
# Through the magic of errexit, we will not get here if the above shell
|
||||||
|
# fails!
|
||||||
|
PATH="${KUBE_ROOT}/third_party/etcd:${PATH}" # export into current process
|
||||||
export PATH
|
export PATH
|
||||||
|
V=3 kube::log::info "added etcd to PATH: ${KUBE_ROOT}/third_party/etcd"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user