[MARIADB][COMMON] Add support for mariadb-operator
[oom.git] / kubernetes / common / mariadb-galera / templates / backup / cronjob.yaml
index 4248cfe..4548626 100644 (file)
@@ -15,6 +15,9 @@
 # limitations under the License.
 */}}
 
+{{- if and .Values.backup.enabled .Values.global.mariadbGalera.useOperator }}
+{{ include "common.mariadbOpBackup" . }}
+{{ else }}
 {{- if and .Values.backup.enabled .Values.persistence.enabled }}
 apiVersion: batch/v1beta1
 kind: CronJob
@@ -77,7 +80,7 @@ spec:
               env:
                 - name: DB_PASS
                   {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" (include "common.mariadb.secret.rootPassUID" .) "key" "password") | indent 18 }}
-              resources: {{ include "common.resources" . | nindent 12 }}
+              resources: {{ include "common.resources" . | nindent 16 }}
               volumeMounts:
                 - name: backup-dir
                   mountPath: /backup
@@ -148,7 +151,7 @@ spec:
                       ls -tr | grep backup | head -$filestoDelete | xargs rm -rf
                     fi
                   fi
-              resources: {{ include "common.resources" . | nindent 12 }}
+              resources: {{ include "common.resources" . | nindent 16 }}
               volumeMounts:
                 - mountPath: /bitnami/mariadb/data
                   name: tmp-data
@@ -180,3 +183,4 @@ spec:
             - name: tmp
               emptyDir: {}
 {{- end }}
+{{- end }}