Skip to content

Commit bac7b67

Browse files
leonardocemnencia
andauthored
fix: custom CA support for retention policies (#224)
Closes #220 Signed-off-by: Leonardo Cecchi <[email protected]> Signed-off-by: Marco Nenciarini <[email protected]> Co-authored-by: Marco Nenciarini <[email protected]>
1 parent 78fe21b commit bac7b67

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

internal/cnpgi/instance/retention.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,14 @@ func (c *CatalogMaintenanceRunnable) maintenance(
109109
return nil
110110
}
111111

112-
env, err := barmanCredentials.EnvSetBackupCloudCredentials(
112+
env, err := barmanCredentials.EnvSetCloudCredentialsAndCertificates(
113113
ctx,
114114
c.Client,
115115
objectStore.Namespace,
116116
&objectStore.Spec.Configuration,
117-
common.MergeEnv(os.Environ(), common.GetRestoreCABundleEnv(&objectStore.Spec.Configuration)))
117+
os.Environ(),
118+
common.BuildCertificateFilePath(objectStore.Name),
119+
)
118120
if err != nil {
119121
contextLogger.Error(err, "while setting backup cloud credentials")
120122
return err

internal/cnpgi/operator/lifecycle_certificates.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ func (impl LifecycleImplementation) collectAdditionalCertificates(
3737
result = append(result, envs...)
3838
}
3939

40-
if len(pluginConfiguration.RecoveryBarmanObjectName) > 0 {
40+
if len(pluginConfiguration.RecoveryBarmanObjectName) > 0 &&
41+
pluginConfiguration.RecoveryBarmanObjectName != pluginConfiguration.BarmanObjectName {
4142
envs, err := impl.collectObjectStoreCertificates(
4243
ctx,
4344
types.NamespacedName{

0 commit comments

Comments
 (0)