feat(provision): check the cluster name provided is exactly 5 chars long
[arvados.git] / tools / salt-install / provision.sh
index facb2e88ef51b9fec772475e803b05c2abf772cf..ce1588c190672b4e7efd07e2e0cfa50122c8cd9f 100755 (executable)
@@ -139,6 +139,12 @@ else
   exit 1
 fi
 
+if ! grep -E '^[[:alnum:]]{5}$' <<<${CLUSTER} ; then
+  echo >&2 "ERROR: <CLUSTER> must be exactly 5 alphanumeric characters long"
+  echo >&2 "Fix the cluster name in the 'local.params' file and re-run the provision script"
+  exit 1
+fi
+
 # Salt's dir
 ## states
 S_DIR="/srv/salt"