[MariaDB] Fix backup/restore scripts for MariaDB 10.6

This patch adds database sys to the list of databases
to be ignored by backup/restore scripts in mariadb chart.

Change-Id: Ida7965bc583ada2c7ca4800c8ff5d6761fb3913a
This commit is contained in:
Markin, Sergiy (sm515x) 2022-05-18 22:16:27 +00:00
parent 88f5713100
commit 1f1a2ff527
4 changed files with 6 additions and 4 deletions

View File

@ -15,7 +15,7 @@ apiVersion: v1
appVersion: v10.2.31
description: OpenStack-Helm MariaDB
name: mariadb
version: 0.2.22
version: 0.2.23
home: https://mariadb.com/kb/en/
icon: http://badges.mariadb.org/mariadb-badge-180x60.png
sources:

View File

@ -44,9 +44,9 @@ dump_databases_to_directory() {
if [[ "${SCOPE}" == "all" ]]; then
MYSQL_DBNAMES=( $($MYSQL --silent --skip-column-names -e \
"show databases;" | \
egrep -vi 'information_schema|performance_schema|mysql') )
grep -ivE 'information_schema|performance_schema|mysql|sys') )
else
if [[ "${SCOPE}" != "information_schema" && "${SCOPE}" != "performance_schema" && "${SCOPE}" != "mysql" ]]; then
if [[ "${SCOPE}" != "information_schema" && "${SCOPE}" != "performance_schema" && "${SCOPE}" != "mysql" && "${SCOPE}" != "sys" ]]; then
MYSQL_DBNAMES=( ${SCOPE} )
else
log ERROR "It is not allowed to backup database ${SCOPE}."

View File

@ -68,7 +68,8 @@ get_databases() {
if [[ -e ${TMP_DIR}/db.list ]]
then
DBS=$(cat ${TMP_DIR}/db.list )
DBS=$(cat ${TMP_DIR}/db.list | \
grep -ivE 'information_schema|performance_schema|mysql|sys' )
else
DBS=" "
fi

View File

@ -38,4 +38,5 @@ mariadb:
- 0.2.20 Migrated CronJob resource to batch/v1 API version & PodDisruptionBudget to policy/v1; Uplift Mariadb-ingress to 1.1.3
- 0.2.21 Fix mysql exporter user privileges
- 0.2.22 Fix ingress cluster role privileges
- 0.2.23 Fix backup script by ignoring sys database for MariaDB 10.6 compartibility
...