From ae75a7d2594002e1924e8ccbcdead90ff14d4731 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Sun, 17 Jan 2016 19:24:03 -0500 Subject: [PATCH] kube-up: move build-runtime-config from AWS & GCE into common --- cluster/aws/util.sh | 22 ---------------------- cluster/common.sh | 22 ++++++++++++++++++++++ cluster/gce/util.sh | 22 ---------------------- 3 files changed, 22 insertions(+), 44 deletions(-) diff --git a/cluster/aws/util.sh b/cluster/aws/util.sh index 66be11c09d..7ec9248e8c 100755 --- a/cluster/aws/util.sh +++ b/cluster/aws/util.sh @@ -1519,25 +1519,3 @@ function get-tokens() { KUBELET_TOKEN=$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64 | tr -d "=+/" | dd bs=32 count=1 2>/dev/null) KUBE_PROXY_TOKEN=$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64 | tr -d "=+/" | dd bs=32 count=1 2>/dev/null) } - -# Builds the RUNTIME_CONFIG var from other feature enable options -function build-runtime-config() { - if [[ "${ENABLE_DEPLOYMENTS}" == "true" ]]; then - if [[ -z "${RUNTIME_CONFIG}" ]]; then - RUNTIME_CONFIG="extensions/v1beta1/deployments=true" - else - if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1/deployments=true"; then - RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/deployments=true" - fi - fi - fi - if [[ "${ENABLE_DAEMONSETS}" == "true" ]]; then - if [[ -z "${RUNTIME_CONFIG}" ]]; then - RUNTIME_CONFIG="extensions/v1beta1/daemonsets=true" - else - if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1/daemonsets=true"; then - RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/daemonsets=true" - fi - fi - fi -} diff --git a/cluster/common.sh b/cluster/common.sh index 895e51ee0a..4bc7ed7e2e 100755 --- a/cluster/common.sh +++ b/cluster/common.sh @@ -419,3 +419,25 @@ function stage-images() { function yaml-quote { echo "'$(echo "${@}" | sed -e "s/'/''/g")'" } + +# Builds the RUNTIME_CONFIG var from other feature enable options +function build-runtime-config() { + if [[ "${ENABLE_DEPLOYMENTS}" == "true" ]]; then + if [[ -z "${RUNTIME_CONFIG}" ]]; then + RUNTIME_CONFIG="extensions/v1beta1/deployments=true" + else + if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1/deployments=true"; then + RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/deployments=true" + fi + fi + fi + if [[ "${ENABLE_DAEMONSETS}" == "true" ]]; then + if [[ -z "${RUNTIME_CONFIG}" ]]; then + RUNTIME_CONFIG="extensions/v1beta1/daemonsets=true" + else + if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1/daemonsets=true"; then + RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/daemonsets=true" + fi + fi + fi +} diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 8da57ef686..43c12eb903 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -1327,28 +1327,6 @@ function prepare-e2e() { detect-project } -# Builds the RUNTIME_CONFIG var from other feature enable options -function build-runtime-config() { - if [[ "${ENABLE_DEPLOYMENTS}" == "true" ]]; then - if [[ -z "${RUNTIME_CONFIG}" ]]; then - RUNTIME_CONFIG="extensions/v1beta1/deployments=true" - else - if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1/deployments=true"; then - RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/deployments=true" - fi - fi - fi - if [[ "${ENABLE_DAEMONSETS}" == "true" ]]; then - if [[ -z "${RUNTIME_CONFIG}" ]]; then - RUNTIME_CONFIG="extensions/v1beta1/daemonsets=true" - else - if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1/daemonsets=true"; then - RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/daemonsets=true" - fi - fi - fi -} - # $1: if 'true', we're building a master yaml, else a node function build-kube-env { local master=$1