diff --git a/mariadb/templates/bin/_restore_mariadb.sh.tpl b/mariadb/templates/bin/_restore_mariadb.sh.tpl index d9c421969..6ee92e406 100755 --- a/mariadb/templates/bin/_restore_mariadb.sh.tpl +++ b/mariadb/templates/bin/_restore_mariadb.sh.tpl @@ -100,6 +100,7 @@ get_rows() { if [[ -e $TMP_DIR/$SQL_FILE ]]; then current_db_desc ${DATABASE} ${TMP_DIR}/${SQL_FILE} \ | grep "INSERT INTO \`${TABLE}\` VALUES" > $ROW_FILE + return 0 else # Error, cannot report the rows echo "No SQL file found - cannot extract the rows" diff --git a/mariadb/templates/cron-job-backup-mariadb.yaml b/mariadb/templates/cron-job-backup-mariadb.yaml index c34263ad2..3a69b4ab6 100644 --- a/mariadb/templates/cron-job-backup-mariadb.yaml +++ b/mariadb/templates/cron-job-backup-mariadb.yaml @@ -27,15 +27,9 @@ metadata: labels: {{ tuple $envAll "mariadb-backup" "backup" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: -{{- if .Values.jobs.backup_mariadb.backoffLimit }} - backoffLimit: {{ .Values.jobs.backup_mariadb.backoffLimit }} -{{- end }} -{{- if .Values.jobs.backup_mariadb.activeDeadlineSeconds }} - activeDeadlineSeconds: {{ .Values.jobs.backup_mariadb.activeDeadlineSeconds }} -{{- end }} - schedule: {{ .Values.jobs.backup_mariadb.cron | quote }} - successfulJobsHistoryLimit: {{ .Values.jobs.backup_mariadb.history.success }} - failedJobsHistoryLimit: {{ .Values.jobs.backup_mariadb.history.failed }} + schedule: {{ .Values.jobs.mariadb_backup.cron | quote }} + successfulJobsHistoryLimit: {{ .Values.jobs.mariadb_backup.history.success }} + failedJobsHistoryLimit: {{ .Values.jobs.mariadb_backup.history.failed }} concurrencyPolicy: Forbid jobTemplate: metadata: @@ -44,6 +38,12 @@ spec: annotations: {{ dict "envAll" $envAll "podName" "mariadb-backup" "containerNames" (list "init" "backup-perms" "mariadb-backup") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} spec: +{{- if .Values.jobs.mariadb_backup.backoffLimit }} + backoffLimit: {{ .Values.jobs.mariadb_backup.backoffLimit }} +{{- end }} +{{- if .Values.jobs.mariadb_backup.activeDeadlineSeconds }} + activeDeadlineSeconds: {{ .Values.jobs.mariadb_backup.activeDeadlineSeconds }} +{{- end }} template: metadata: labels: diff --git a/mariadb/values.yaml b/mariadb/values.yaml index 18de2ee5f..6c17bf5e3 100644 --- a/mariadb/values.yaml +++ b/mariadb/values.yaml @@ -226,10 +226,12 @@ dependencies: services: - endpoint: error_pages service: oslo_db - backup_mariadb: + mariadb_backup: jobs: - mariadb-ks-user - services: null + services: + - endpoint: internal + service: oslo_db prometheus_create_mysql_user: services: - endpoint: internal @@ -250,10 +252,6 @@ dependencies: services: - endpoint: internal service: local_image_registry - mariadb_backup: - services: - - endpoint: internal - service: oslo_db tests: services: - endpoint: internal @@ -278,7 +276,7 @@ jobs: exporter_create_sql_user: backoffLimit: 87600 activeDeadlineSeconds: 3600 - backup_mariadb: + mariadb_backup: # activeDeadlineSeconds == 0 means no deadline activeDeadlineSeconds: 0 backoffLimit: 6