Merge pull request #16624 from mikedanese/enable-fix

build kube-env in build-kube-env, not in verify-prereqs
pull/6/head
Mike Danese 2015-11-02 14:06:48 -08:00
commit 8fc36e6068
3 changed files with 33 additions and 27 deletions

View File

@ -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

View File

@ -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))

View File

@ -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
}