From 6543036ebbd1afa1313862b2105bf8b891ea5757 Mon Sep 17 00:00:00 2001 From: cris Date: Fri, 28 Apr 2023 09:38:39 +0800 Subject: [PATCH] backup:fix s3 backup empty env --- controllers/backup/backup_controller.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controllers/backup/backup_controller.go b/controllers/backup/backup_controller.go index bd68667e..9023b060 100644 --- a/controllers/backup/backup_controller.go +++ b/controllers/backup/backup_controller.go @@ -504,8 +504,10 @@ func generateBackupJobSpec(backup *v1beta1.Backup, cluster *v1beta1.MysqlCluster getEnvVarFromSecret(clusterAuthsctName, "BACKUP_USER", "backup-user", true), getEnvVarFromSecret(clusterAuthsctName, "BACKUP_PASSWORD", "backup-password", true), ) - if NFSBackupEnv != nil && S3BackuptEnv != nil { + if NFSBackupEnv != nil { container.Env = append(container.Env, *NFSBackupEnv) + } + if S3BackuptEnv != nil { container.Env = append(container.Env, S3BackuptEnv...) }