From e3b9004c7a5e7e2198d74b4a6a082a6dc0749311 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..822c5e9c 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 len(S3BackuptEnv) != 0 { container.Env = append(container.Env, S3BackuptEnv...) }