From 5fa11322f86ccbdd30f76d6ab637a03082820ec0 Mon Sep 17 00:00:00 2001 From: Dawn Chen Date: Tue, 28 Apr 2015 01:22:25 -0700 Subject: [PATCH] Factory out debian e.g. ContainerVM image specific support to its own helper utility library. --- cluster/gce/configure-vm.sh | 2 +- cluster/gce/debian/helper.sh | 100 +++++++++++++++++++++++++++++++++++ cluster/gce/util.sh | 87 +++--------------------------- 3 files changed, 107 insertions(+), 82 deletions(-) create mode 100644 cluster/gce/debian/helper.sh diff --git a/cluster/gce/configure-vm.sh b/cluster/gce/configure-vm.sh index 753cb3de90c..7f274d4bccb 100644 --- a/cluster/gce/configure-vm.sh +++ b/cluster/gce/configure-vm.sh @@ -1,5 +1,5 @@ #!/bin/bash - +set -x # Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cluster/gce/debian/helper.sh b/cluster/gce/debian/helper.sh new file mode 100644 index 00000000000..9ee97c81a8f --- /dev/null +++ b/cluster/gce/debian/helper.sh @@ -0,0 +1,100 @@ +#!/bin/bash + +# Copyright 2015 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A library of helper functions and constant for debian os distro + +# $1: if 'true', we're building a master yaml, else a node +function build-kube-env { + local master=$1 + local file=$2 + + rm -f ${file} + cat >$file <>$file <&2 + source "${KUBE_ROOT}/cluster/gce/${OS_DISTRIBUTION}/helper.sh" +fi + NODE_INSTANCE_PREFIX="${INSTANCE_PREFIX}-minion" KUBE_PROMPT_FOR_UPDATE=y @@ -448,48 +453,6 @@ function yaml-quote { echo "'$(echo "${@}" | sed -e "s/'/''/g")'" } -# $1: if 'true', we're building a master yaml, else a node -function build-kube-env { - local master=$1 - local file=$2 - - rm -f ${file} - cat >$file <>$file <