summaryrefslogtreecommitdiffstats
path: root/kubernetes/sdnc/resources/geo/bin/sdnc.isPrimaryCluster
diff options
context:
space:
mode:
authorMike Elliott <mike.elliott@amdocs.com>2018-04-06 16:47:11 +0000
committerGerrit Code Review <gerrit@onap.org>2018-04-06 16:47:11 +0000
commit9803cd9b8562e112e139bf7e5eae5613137ff4ca (patch)
tree4f1fde63a7f8bd98fb5f498b3bccbf6c820e2032 /kubernetes/sdnc/resources/geo/bin/sdnc.isPrimaryCluster
parentb24c89e1bb8717af57fea2d8a6a6016f6f4857e1 (diff)
parentde45c68c288c44af517d4a403b8a154a715df555 (diff)
Merge "Multi-site High-availability Manual Failover (PoC)"
Diffstat (limited to 'kubernetes/sdnc/resources/geo/bin/sdnc.isPrimaryCluster')
-rwxr-xr-xkubernetes/sdnc/resources/geo/bin/sdnc.isPrimaryCluster19
1 files changed, 19 insertions, 0 deletions
diff --git a/kubernetes/sdnc/resources/geo/bin/sdnc.isPrimaryCluster b/kubernetes/sdnc/resources/geo/bin/sdnc.isPrimaryCluster
new file mode 100755
index 0000000000..8e816c4153
--- /dev/null
+++ b/kubernetes/sdnc/resources/geo/bin/sdnc.isPrimaryCluster
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+OOM_HOME=${OOM_HOME:-$HOME}
+
+IS_PRIMARY_CLUSTER=`awk '/isPrimaryODLCluster/ {print $2}' ${OOM_HOME}/oom/kubernetes/sdnc/values.yaml`
+
+if [ "$?" -eq "2" ]; then
+ echo "Make sure you are ubuntu user." >&2
+fi
+
+case $IS_PRIMARY_CLUSTER in
+true|false)
+ echo $IS_PRIMARY_CLUSTER
+ ;;
+*)
+ echo "NOT CLUSTERED"
+ exit 1
+ ;;
+esac