X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ric-infra%2F15-Chartmuseum%2Fbin%2Finstall;h=6a6fe8c0dcbc0ff86afc52a25dc14c601a3cbb0c;hb=refs%2Fchanges%2F41%2F741%2F6;hp=f1a3bb83b549dac2dfa3594799572d95b2154bea;hpb=bb6097c9e2fa2918028892b2c5e675841029bee9;p=it%2Fdep.git diff --git a/ric-infra/15-Chartmuseum/bin/install b/ric-infra/15-Chartmuseum/bin/install index f1a3bb83..6a6fe8c0 100755 --- a/ric-infra/15-Chartmuseum/bin/install +++ b/ric-infra/15-Chartmuseum/bin/install @@ -59,14 +59,60 @@ fi +NODENAME=$(kubectl get node | awk '{print $1}') +LABELFOUND=false +for f in $NODENAME; do + LABEL=$(kubectl describe node $f | grep local-storage) + if [ ! -z "$LABEL" ]; then + LABELFOUND=true + fi +done + +if [ ! -z $OVERRIDEYAML ]; then + FOUND_STORAGECLASS=$(grep storageclass $OVERRIDEYAML) +fi + + + +if ! $LABELFOUND && [ -z "$FOUND_STORAGECLASS" ]; then + echo "***********************************************************************************************" + echo "* ERROR!!!!!!!!!!!!! *" + echo "***********************************************************************************************" + echo "* Nodes label \"local-storage=enable\" is not found in any of the cluster node. *" + echo "* Please pick a node and label it using the following command. *" + echo "* kubectl label --overwrite nodes local-storage=enable *" + echo "***********************************************************************************************" + + exit 1 +fi + + -NODENAME=$(kubectl get node | awk 'NR==2{print $1}') -kubectl label --overwrite nodes $NODENAME helm-node=enable -DIRTEMP=$DIR -. ./clear_data_path -DIR=$DIRTEMP +if [ -z "$FOUND_STORAGECLASS" ] && $LABELFOUND; then + DATAPATH=$(cat $DIR/../helm/chartmuseum/values.yaml | grep datapath | awk '{ print $2}' ) + + + if [ ! -z $OVERRIDEYAML ]; then + DATAPATHOVERRIDE=$(cat $OVERRIDEYAML | grep datapath | awk '{ print $2}' ) + fi + + if [ ! -z "$DATAPATHOVERRIDE" ]; then + DATAPATH=$DATAPATHOVERRIDE + fi + + + echo "***********************************************************************************************" + echo "* WARNING!!!!!!!!!!!!! *" + echo "***********************************************************************************************" + echo "* Chartmuseume will use local storage. Please make sure that directory *" + echo "* $DATAPATH *" + echo "* exists on the selected cluster node, and contains the proper files. *" + echo "***********************************************************************************************" + + +fi RICINFRA_COMPONENTS="chartmuseum" @@ -79,11 +125,10 @@ helm package -d /tmp $DIR/../../../ric-common/Common-Template/helm/ric-common - - for component in $RICINFRA_COMPONENTS; do mkdir -p $DIR/../helm/$component/charts/ + cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/ if [ -z $OVERRIDEYAML ]; then