Make join cluster function in federation-up.sh a little more succinct.

This commit is contained in:
Madhusudan.C.S 2017-02-16 13:26:19 -08:00
parent 48d7842211
commit ceb88b3869
2 changed files with 4 additions and 5 deletions

View File

@ -60,7 +60,7 @@ HOST_CLUSTER_CONTEXT="${FEDERATION_HOST_CLUSTER_CONTEXT:-${1}}"
# kube-dns configuration.
KUBEDNS_CONFIGMAP_NAME="kube-dns"
KUBEDNS_CONFIGMAP_NAMESPACE = "kube-system"
KUBEDNS_CONFIGMAP_NAMESPACE="kube-system"
KUBEDNS_FEDERATION_FLAG="federations"
host_kubectl="${KUBE_ROOT}/cluster/kubectl.sh --namespace=${FEDERATION_NAMESPACE}"

View File

@ -87,9 +87,9 @@ function init() {
--image="${kube_registry}/hyperkube-amd64:${kube_version}"
}
# join_cluster_to_federation joins the clusters in the local kubeconfig to federation. The clusters
# join_clusters joins the clusters in the local kubeconfig to federation. The clusters
# and their kubeconfig entries in the local kubeconfig are created while deploying clusters, i.e. when kube-up is run.
function join_cluster_to_federation() {
function join_clusters() {
for cluster in $("${KUBE_ROOT}/cluster/kubectl.sh" config get-clusters |sed -n '1!p'); do
# Skip federation context
if [[ "${cluster}" == "${FEDERATION_NAME}" ]]; then
@ -114,8 +114,7 @@ USE_KUBEFED="${USE_KUBEFED:-}"
if [[ "${USE_KUBEFED}" == "true" ]]; then
init
join_cluster_to_federation
join_clusters
else
export FEDERATION_IMAGE_TAG="$(get_version)"
create-federation-api-objects