Skip to content

Commit

Permalink
Merge pull request #7 from omnivector-solutions/tucker/fix-democluste…
Browse files Browse the repository at this point in the history
…r-naming

Fixed democluster naming to be (more) unique
  • Loading branch information
dusktreader authored Mar 11, 2024
2 parents ef98344 + 02a8f43 commit eff7b57
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion public-scripts/deploy-democluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,16 @@ EOF
fi
mkdir -p $HOME/democluster/tmp

# Extract the cluster name from the CLIENT_ID if possible. If not, use a timestamped generic name
democluster_name=$(echo $CLIENT_ID | perl -pe "s/(.*)-[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}/\1/")
if [ "$CLIENT_ID" = "$democluster_name" ]; then
democluster_name="democluster-$(date +'%Y-%m-%d')"
fi

cat /tmp/cloud-init.yaml | multipass launch -c$(nproc) \
-m4GB \
--mount=$HOME/democluster:/home/ubuntu/democluster \
-ndemocluster \
-n${democluster_name} \
$IMAGE_ORIGIN \
--cloud-init -

Expand Down

0 comments on commit eff7b57

Please sign in to comment.