X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ric-infra%2F15-Chartmuseum%2Fbin%2Finstall;h=6a6fe8c0dcbc0ff86afc52a25dc14c601a3cbb0c;hb=94c2d5d12d92abefa2ed0d85ed3e7f8b5bc7ed71;hp=ae097feaa358af0d588ce4215abbdcd3cd614416;hpb=00e1990cde6660b9875b312834fb58683456ec70;p=it%2Fdep.git diff --git a/ric-infra/15-Chartmuseum/bin/install b/ric-infra/15-Chartmuseum/bin/install index ae097fea..6a6fe8c0 100755 --- a/ric-infra/15-Chartmuseum/bin/install +++ b/ric-infra/15-Chartmuseum/bin/install @@ -59,17 +59,62 @@ 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 + + + + +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 + -NODENAME=$(kubectl get node | awk 'NR==2{print $1}') -kubectl label --overwrite nodes $NODENAME helm-node=enable + 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 "***********************************************************************************************" -DIRTEMP=$DIR -. "$DIR/clear_data_path" -DIR=$DIRTEMP +fi RICINFRA_COMPONENTS="chartmuseum" -mkdir -p /tmp/chartmuseum-data echo "Deploying RIC infra components [$RICINFRA_COMPONENTS]" echo "Helm Release Name: $RELEASE_NAME"