mirror of https://github.com/k3s-io/k3s
Merge pull request #16624 from mikedanese/enable-fix
build kube-env in build-kube-env, not in verify-prereqspull/6/head
commit
8fc36e6068
|
@ -21,6 +21,8 @@ function build-kube-env {
|
||||||
local master=$1
|
local master=$1
|
||||||
local file=$2
|
local file=$2
|
||||||
|
|
||||||
|
build-runtime-config
|
||||||
|
|
||||||
rm -f ${file}
|
rm -f ${file}
|
||||||
# TODO(dawnchen): master node is still running with debian image
|
# TODO(dawnchen): master node is still running with debian image
|
||||||
if [[ "${master}" == "true" ]]; then
|
if [[ "${master}" == "true" ]]; then
|
||||||
|
|
|
@ -21,6 +21,8 @@ function build-kube-env {
|
||||||
local master=$1
|
local master=$1
|
||||||
local file=$2
|
local file=$2
|
||||||
|
|
||||||
|
build-runtime-config
|
||||||
|
|
||||||
rm -f ${file}
|
rm -f ${file}
|
||||||
cat >$file <<EOF
|
cat >$file <<EOF
|
||||||
ENV_TIMESTAMP: $(yaml-quote $(date -u +%Y-%m-%dT%T%z))
|
ENV_TIMESTAMP: $(yaml-quote $(date -u +%Y-%m-%dT%T%z))
|
||||||
|
|
|
@ -48,33 +48,6 @@ function join_csv {
|
||||||
|
|
||||||
# Verify prereqs
|
# Verify prereqs
|
||||||
function verify-prereqs {
|
function verify-prereqs {
|
||||||
if [[ "${ENABLE_EXPERIMENTAL_API}" == "true" ]]; then
|
|
||||||
if [[ -z "${RUNTIME_CONFIG}" ]]; then
|
|
||||||
RUNTIME_CONFIG="extensions/v1beta1=true"
|
|
||||||
else
|
|
||||||
# TODO: add checking if RUNTIME_CONFIG contains "extensions/v1beta1=false" and appending "extensions/v1beta1=true" if not.
|
|
||||||
if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1=true"; then
|
|
||||||
echo "Experimental API should be turned on, but is not turned on in RUNTIME_CONFIG!" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [[ "${ENABLE_DEPLOYMENTS}" == "true" ]]; then
|
|
||||||
if [[ -z "${RUNTIME_CONFIG}" ]]; then
|
|
||||||
RUNTIME_CONFIG="extensions/v1beta1/deployments=true"
|
|
||||||
else
|
|
||||||
RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/deployments=true"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [[ "${ENABLE_DAEMONSETS}" == "true" ]]; then
|
|
||||||
if [[ -z "${RUNTIME_CONFIG}" ]]; then
|
|
||||||
RUNTIME_CONFIG="extensions/v1beta1/daemonsets=true"
|
|
||||||
else
|
|
||||||
RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/daemonsets=true"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
local cmd
|
local cmd
|
||||||
for cmd in gcloud gsutil; do
|
for cmd in gcloud gsutil; do
|
||||||
if ! which "${cmd}" >/dev/null; then
|
if ! which "${cmd}" >/dev/null; then
|
||||||
|
@ -1255,3 +1228,32 @@ function restart-apiserver {
|
||||||
function prepare-e2e() {
|
function prepare-e2e() {
|
||||||
detect-project
|
detect-project
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Builds the RUNTIME_CONFIG var from other feature enable options
|
||||||
|
function build-runtime-config() {
|
||||||
|
if [[ "${ENABLE_EXPERIMENTAL_API}" == "true" ]]; then
|
||||||
|
if [[ -z "${RUNTIME_CONFIG}" ]]; then
|
||||||
|
RUNTIME_CONFIG="extensions/v1beta1=true"
|
||||||
|
else
|
||||||
|
# TODO: add checking if RUNTIME_CONFIG contains "extensions/v1beta1=false" and appending "extensions/v1beta1=true" if not.
|
||||||
|
if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1=true"; then
|
||||||
|
echo "Experimental API should be turned on, but is not turned on in RUNTIME_CONFIG!" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [[ "${ENABLE_DEPLOYMENTS}" == "true" ]]; then
|
||||||
|
if [[ -z "${RUNTIME_CONFIG}" ]]; then
|
||||||
|
RUNTIME_CONFIG="extensions/v1beta1/deployments=true"
|
||||||
|
else
|
||||||
|
RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/deployments=true"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [[ "${ENABLE_DAEMONSETS}" == "true" ]]; then
|
||||||
|
if [[ -z "${RUNTIME_CONFIG}" ]]; then
|
||||||
|
RUNTIME_CONFIG="extensions/v1beta1/daemonsets=true"
|
||||||
|
else
|
||||||
|
RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/daemonsets=true"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue