mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 12:32:03 +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() {
|
||||
# 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 arch
|
||||
|
||||
@ -152,12 +159,8 @@ kube::etcd::install() {
|
||||
|
||||
cd "${KUBE_ROOT}/third_party" || return 1
|
||||
if [[ $(readlink etcd) == etcd-v${ETCD_VERSION}-${os}-* ]]; then
|
||||
kube::log::info "etcd v${ETCD_VERSION} already installed. To use:"
|
||||
kube::log::info "export PATH=\"$(pwd)/etcd:\${PATH}\""
|
||||
# export into current process
|
||||
PATH="$(pwd)/etcd:${PATH}"
|
||||
export PATH
|
||||
return #already installed
|
||||
V=3 kube::log::info "etcd v${ETCD_VERSION} is already installed"
|
||||
return 0 # already installed
|
||||
fi
|
||||
|
||||
if [[ ${os} == "darwin" ]]; then
|
||||
@ -176,10 +179,14 @@ kube::etcd::install() {
|
||||
rm "${download_file}"
|
||||
else
|
||||
kube::log::info "${os} is NOT supported."
|
||||
return 1
|
||||
fi
|
||||
kube::log::info "etcd v${ETCD_VERSION} installed. To use:"
|
||||
kube::log::info "export PATH=\"$(pwd)/etcd:\${PATH}\""
|
||||
# export into current process
|
||||
PATH="$(pwd)/etcd:${PATH}"
|
||||
V=4 kube::log::info "installed etcd v${ETCD_VERSION}"
|
||||
return 0 # newly installed
|
||||
)
|
||||
# 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
|
||||
V=3 kube::log::info "added etcd to PATH: ${KUBE_ROOT}/third_party/etcd"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user