mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 13:12:20 +00:00
Update scripts to look for binary artifacts in bazel-bin/
This commit is contained in:
@@ -412,6 +412,30 @@ function tars_from_version() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Search for the specified tarball in the various known output locations,
|
||||
# echoing the location if found.
|
||||
#
|
||||
# Assumed vars:
|
||||
# KUBE_ROOT
|
||||
#
|
||||
# Args:
|
||||
# $1 name of tarball to search for
|
||||
function find-tar() {
|
||||
local -r tarball=$1
|
||||
locations=(
|
||||
"${KUBE_ROOT}/server/${tarball}"
|
||||
"${KUBE_ROOT}/_output/release-tars/${tarball}"
|
||||
"${KUBE_ROOT}/bazel-bin/build/release-tars/${tarball}"
|
||||
)
|
||||
location=$( (ls -t "${locations[@]}" 2>/dev/null || true) | head -1 )
|
||||
|
||||
if [[ ! -f "${location}" ]]; then
|
||||
echo "!!! Cannot find ${tarball}" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "${location}"
|
||||
}
|
||||
|
||||
# Verify and find the various tar files that we are going to use on the server.
|
||||
#
|
||||
# Assumed vars:
|
||||
@@ -421,36 +445,14 @@ function tars_from_version() {
|
||||
# SALT_TAR
|
||||
# KUBE_MANIFESTS_TAR
|
||||
function find-release-tars() {
|
||||
SERVER_BINARY_TAR="${KUBE_ROOT}/server/kubernetes-server-linux-amd64.tar.gz"
|
||||
if [[ ! -f "${SERVER_BINARY_TAR}" ]]; then
|
||||
SERVER_BINARY_TAR="${KUBE_ROOT}/_output/release-tars/kubernetes-server-linux-amd64.tar.gz"
|
||||
fi
|
||||
if [[ ! -f "${SERVER_BINARY_TAR}" ]]; then
|
||||
echo "!!! Cannot find kubernetes-server-linux-amd64.tar.gz" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SALT_TAR="${KUBE_ROOT}/server/kubernetes-salt.tar.gz"
|
||||
if [[ ! -f "${SALT_TAR}" ]]; then
|
||||
SALT_TAR="${KUBE_ROOT}/_output/release-tars/kubernetes-salt.tar.gz"
|
||||
fi
|
||||
if [[ ! -f "${SALT_TAR}" ]]; then
|
||||
echo "!!! Cannot find kubernetes-salt.tar.gz" >&2
|
||||
exit 1
|
||||
fi
|
||||
SERVER_BINARY_TAR=$(find-tar kubernetes-server-linux-amd64.tar.gz)
|
||||
SALT_TAR=$(find-tar kubernetes-salt.tar.gz)
|
||||
|
||||
# This tarball is used by GCI, Ubuntu Trusty, and Container Linux.
|
||||
KUBE_MANIFESTS_TAR=
|
||||
if [[ "${MASTER_OS_DISTRIBUTION:-}" == "trusty" || "${MASTER_OS_DISTRIBUTION:-}" == "gci" || "${MASTER_OS_DISTRIBUTION:-}" == "container-linux" ]] || \
|
||||
[[ "${NODE_OS_DISTRIBUTION:-}" == "trusty" || "${NODE_OS_DISTRIBUTION:-}" == "gci" || "${NODE_OS_DISTRIBUTION:-}" == "container-linux" ]] ; then
|
||||
KUBE_MANIFESTS_TAR="${KUBE_ROOT}/server/kubernetes-manifests.tar.gz"
|
||||
if [[ ! -f "${KUBE_MANIFESTS_TAR}" ]]; then
|
||||
KUBE_MANIFESTS_TAR="${KUBE_ROOT}/_output/release-tars/kubernetes-manifests.tar.gz"
|
||||
fi
|
||||
if [[ ! -f "${KUBE_MANIFESTS_TAR}" ]]; then
|
||||
echo "!!! Cannot find kubernetes-manifests.tar.gz" >&2
|
||||
exit 1
|
||||
fi
|
||||
KUBE_MANIFESTS_TAR=$(find-tar kubernetes-manifests.tar.gz)
|
||||
fi
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user