From 9265eb065c25b6e772d8da40f804c7e384a142cf Mon Sep 17 00:00:00 2001 From: Ian Stanton Date: Wed, 25 Sep 2024 20:02:37 -0400 Subject: [PATCH] Fill in backup values Signed-off-by: Ian Stanton --- tembo-operator/src/cloudnativepg/cnpg.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tembo-operator/src/cloudnativepg/cnpg.rs b/tembo-operator/src/cloudnativepg/cnpg.rs index 31acada6b..2fae4facf 100644 --- a/tembo-operator/src/cloudnativepg/cnpg.rs +++ b/tembo-operator/src/cloudnativepg/cnpg.rs @@ -2129,7 +2129,12 @@ fn generate_azure_backup_credentials( // If we're not inheriting from Azure AD, assume we are reading from a Kubernetes secret. // https://cloudnative-pg.io/documentation/1.16/backup_recovery/#azure-blob-storage Some(ClusterBackupBarmanObjectStoreAzureCredentials { - connection_string: None, + connection_string: creds.connection_string.as_ref().map(|cs| { + ClusterBackupBarmanObjectStoreAzureCredentialsConnectionString { + key: cs.key.clone(), + name: cs.name.clone(), + } + }), storage_account: creds.storage_account.as_ref().map(|sa| { ClusterBackupBarmanObjectStoreAzureCredentialsStorageAccount { key: sa.key.clone(), @@ -2142,7 +2147,12 @@ fn generate_azure_backup_credentials( name: sk.name.clone(), } }), - storage_sas_token: None, + storage_sas_token: creds.storage_sas_token.as_ref().map(|st| { + ClusterBackupBarmanObjectStoreAzureCredentialsStorageSasToken { + key: st.key.clone(), + name: st.name.clone(), + } + }), inherit_from_azure_ad: None, }) } else {