Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build kube-env in build-kube-env, not in verify-prereqs #16718

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions cluster/gce/coreos/helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ function build-kube-env {
local master=$1
local file=$2

build-runtime-config

rm -f ${file}
# TODO(dawnchen): master node is still running with debian image
if [[ "${master}" == "true" ]]; then
Expand Down
2 changes: 2 additions & 0 deletions cluster/gce/debian/helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ function build-kube-env {
local master=$1
local file=$2

build-runtime-config

rm -f ${file}
cat >$file <<EOF
ENV_TIMESTAMP: $(yaml-quote $(date -u +%Y-%m-%dT%T%z))
Expand Down
56 changes: 29 additions & 27 deletions cluster/gce/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,33 +53,6 @@ function join_csv {

# 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
for cmd in gcloud gsutil; do
if ! which "${cmd}" >/dev/null; then
Expand Down Expand Up @@ -1243,3 +1216,32 @@ function restart-apiserver {
function prepare-e2e() {
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
}