X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=tools%2Fk8s%2Fbin%2Fgen-cloud-init.sh;h=42ecff411a50ee7e05d15eaca867027ce180b008;hb=refs%2Fchanges%2F84%2F4284%2F1;hp=6722b7e80127259f359799a383ef70bf5c9a94c2;hpb=dc00cdf008775e2ac5dddb186d1eb81e80370b69;p=it%2Fdep.git diff --git a/tools/k8s/bin/gen-cloud-init.sh b/tools/k8s/bin/gen-cloud-init.sh index 6722b7e8..42ecff41 100755 --- a/tools/k8s/bin/gen-cloud-init.sh +++ b/tools/k8s/bin/gen-cloud-init.sh @@ -33,7 +33,7 @@ usage() { DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" set -a -RCS="$(find $DIR/../etc -type f -maxdepth 1)" +RCS="$(find $DIR/../etc -maxdepth 1 -type f)" for RC in $RCS; do echo "reading in values in $RC" source $RC @@ -44,10 +44,11 @@ set +a if [ -z "$WORKSPACE" ]; then export WORKSPACE=`git rev-parse --show-toplevel` fi -HEAT_DIR="$WORKSPACE/ric-infra/00-Kubernetes/heat" -BIN_DIR="$WORKSPACE/ric-infra/00-Kubernetes/bin" -ETC_DIR="$WORKSPACE/ric-infra/00-Kubernetes/etc" -ENV_DIR="$WORKSPACE/ric-infra/00-Kubernetes/heat/env" + +HEAT_DIR="$WORKSPACE/tools/k8s/heat" +BIN_DIR="$WORKSPACE/tools/k8s/bin" +ETC_DIR="$WORKSPACE/tools/k8s/etc" +ENV_DIR="$WORKSPACE/tools/k8s/heat/env" if [ -z "$1" ]; then TMPL="${HEAT_DIR}/scripts/k8s_vm_install.sh" @@ -143,8 +144,11 @@ sed -i -e "s/__stack_name__/\$(hostname)/g" "$filename" # because cloud init user data has a 16kB limit, remove all comment lines to save space. # except for the #! line -sed -i -e '/^[ \t]*#[^!]/d' "$filename" +sed -i -e '/^[ \t]*#[^!]/d' "$filename" chmod +x "$filename" -mv "$filename" ./k8s-1node-cloud-init.sh +K8SV=$(echo ${INFRA_K8S_VERSION} | cut -f 1-2 -d '.' | sed -e 's/\./_/g') +HV=$(echo ${INFRA_HELM_VERSION} | cut -f 1-2 -d '.' | sed -e 's/\./_/g') +DV=$(echo ${INFRA_DOCKER_VERSION} | cut -f 1-2 -d '.' | sed -e 's/\./_/g') +mv "$filename" ./k8s-1node-cloud-init-k_${K8SV:-cur}-h_${HV:-cur}-d_${DV:-cur}.sh