Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/prepare_restored_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
function get_password() {
local user=$1

escape_special $(</etc/mysql/mysql-users-secret/${user})

Check warning on line 16 in build/prepare_restored_cluster.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] build/prepare_restored_cluster.sh#L16 <ShellCheck.SC2046>

Quote this to prevent word splitting.
Raw output
./build/prepare_restored_cluster.sh:16:17: warning: Quote this to prevent word splitting. (ShellCheck.SC2046)

Check notice on line 16 in build/prepare_restored_cluster.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] build/prepare_restored_cluster.sh#L16 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./build/prepare_restored_cluster.sh:16:50: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
}

MYSQL_VERSION=$(mysqld -V | awk '{print $3}' | awk -F'.' '{print $1"."$2}')
Expand All @@ -21,7 +21,7 @@

vault_secret="/etc/mysql/vault-keyring-secret/keyring_vault.conf"
if [ -f "${vault_secret}" ]; then
if [[ $MYSQL_VERSION == '8.0' ]]; then
if [[ $MYSQL_VERSION =~ ^(5\.7|8\.0)$ ]]; then
sed -i "/\[mysqld\]/a early-plugin-load=keyring_vault.so" $CFG
sed -i "/\[mysqld\]/a keyring_vault_config=${vault_secret}" $CFG
fi
Expand Down
14 changes: 8 additions & 6 deletions build/pxc-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ escape_special() {
MYSQL_VERSION=$(mysqld -V | awk '{print $3}' | awk -F'.' '{print $1"."$2}')
MYSQL_PATCH_VERSION=$(mysqld -V | awk '{print $3}' | awk -F'.' '{print $3}' | awk -F'-' '{print $1}')

vault_secret="/etc/mysql/vault-keyring-secret/keyring_vault.conf"
if [ -f "$vault_secret" ]; then
if [[ $MYSQL_VERSION =~ ^(5\.7|8\.0)$ ]]; then
sed -i "/\[mysqld\]/a early-plugin-load=keyring_vault.so" $CFG
sed -i "/\[mysqld\]/a keyring_vault_config=$vault_secret" $CFG
fi
fi

if [ "$MYSQL_VERSION" == '8.0' ]; then
sed -i '/\[mysqld\]/a plugin_load="binlog_utils_udf=binlog_utils_udf.so"' $CFG
fi
Expand Down Expand Up @@ -498,13 +506,7 @@ if [ -z "$CLUSTER_JOIN" ] && [ "$1" = 'mysqld' ] && [ -z "$wantHelp" ]; then
fi

# if vault secret file exists we assume we need to turn on encryption
vault_secret="/etc/mysql/vault-keyring-secret/keyring_vault.conf"
if [ -f "$vault_secret" ]; then
if [[ $MYSQL_VERSION == '8.0' ]]; then
sed -i "/\[mysqld\]/a early-plugin-load=keyring_vault.so" $CFG
sed -i "/\[mysqld\]/a keyring_vault_config=$vault_secret" $CFG
fi

if [[ $MYSQL_VERSION == '8.4' ]]; then
echo -n '{ "components": "file://component_keyring_vault" }' >/var/lib/mysql/mysqld.my
cp ${vault_secret} /var/lib/mysql/component_keyring_vault.cnf
Expand Down
12 changes: 8 additions & 4 deletions e2e-tests/demand-backup-cloud-pxb/run
Original file line number Diff line number Diff line change
Expand Up @@ -230,19 +230,23 @@ main() {
check_backup_existence_azure "${backup_dest_azure}" "/xtrabackup_binlog_info.00000000000000000000"

kubectl_bin delete pxc-backup --all
dest_file="/xtrabackup_binlog_info.00000000000000000000"
if [[ $MYSQL_VERSION == "5.7" ]]; then
dest_file="/xtrabackup_info.00000000000000000000"
fi

desc "Check backup deletion"
check_backup_deletion_aws "$backup_dest_aws" "/xtrabackup_binlog_info.00000000000000000000"
check_backup_deletion_gcs "${backup_dest_gcp}" "/xtrabackup_binlog_info.00000000000000000000"
check_backup_deletion_azure "${backup_dest_azure}" "/xtrabackup_binlog_info.00000000000000000000"
check_backup_deletion_aws "$backup_dest_aws" "$dest_file"
check_backup_deletion_gcs "${backup_dest_gcp}" "$dest_file"
check_backup_deletion_azure "${backup_dest_azure}" "$dest_file"

if [ "$EKS" = 1 ]; then
backup_name_aws_iam="on-demand-backup-aws-s3-iam"
desc "Run backup ${backup_name_aws_iam} for $cluster cluster using IAM"
run_backup_with_delete "${backup_name_aws_iam}"
desc "Check backup existence for $backup_name_aws_iam"
backup_dest_aws_iam=$(kubectl_bin get pxc-backup "$backup_name_aws_iam" -o jsonpath='{.status.destination}' | sed -e 's/.json$//' | cut -c 6-)
check_backup_existence_aws "${backup_dest_aws_iam}" ".xtrabackup_binlog_info.00000000000000000000"
check_backup_existence_aws "${backup_dest_aws_iam}" "$dest_file"
fi

destroy $namespace
Expand Down
2 changes: 2 additions & 0 deletions e2e-tests/run-pr.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ cross-site,8.0
custom-users,8.0
demand-backup-cloud,8.0
demand-backup-cloud-pxb,8.0
demand-backup-encrypted-with-tls,5.7
demand-backup-encrypted-with-tls,8.0
demand-backup-encrypted-with-tls,8.4
demand-backup-encrypted-with-tls-pxb,5.7
demand-backup-encrypted-with-tls-pxb,8.0
demand-backup-encrypted-with-tls-pxb,8.4
demand-backup,8.0
Expand Down
Loading