[COMMON] More generic Cassandra backup 53/113853/3
authorMarat Salakhutdinov <marat.salakhutdinov@bell.ca>
Tue, 13 Oct 2020 23:22:15 +0000 (19:22 -0400)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Wed, 14 Oct 2020 12:25:47 +0000 (12:25 +0000)
This patch will fix handling of the backup of cassandra installed with
different than "cassandra" common name.

Issue-ID: OOM-2596
Signed-off-by: Marat Salakhutdinov <marat.salakhutdinov@bell.ca>
Change-Id: Ifff440af79d6626fdbd1c2948795f98aabd167d7

kubernetes/common/cassandra/templates/backup/cronjob.yaml

index 1d1e459..cabe59f 100644 (file)
@@ -59,7 +59,7 @@ spec:
                   curr_time=$1
                   echo "Clearing snapshots!!!"
                   command="nodetool clearsnapshot -t $curr_time"
-                  /app/exec.py -p "cassandra" -c "$command"
+                  /app/exec.py -p "{{ include "common.name" . }}" -c "$command"
                 }
                 {{ $root := . }}
                 curr_time=`date +%s`
@@ -75,11 +75,11 @@ spec:
 
                 echo "Executing cleanup!!"
                 command="nodetool cleanup"
-                /app/exec.py -p "cassandra" -c "$command"
+                /app/exec.py -p "{{ include "common.name" . }}" -c "$command"
                 echo "Cleaned Node!! Backing up database now!!!"
 
                 command="nodetool snapshot -t $curr_time"
-                /app/exec.py -p "cassandra" -c "$command"
+                /app/exec.py -p "{{ include "common.name" . }}" -c "$command"
                 retCode=$?
                 if [ $retCode -ne 0 ]; then
                   echo "Backup Failed!!!"