From b2672465e9c28cc03be903aa69ebfab05403d73e Mon Sep 17 00:00:00 2001 From: Nick Hudson Date: Fri, 1 Nov 2024 18:09:45 -0500 Subject: [PATCH] rename config value --- tembo-operator/src/cloudnativepg/cnpg.rs | 8 ++++---- tembo-operator/src/config.rs | 6 +++--- tembo-operator/src/controller.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tembo-operator/src/cloudnativepg/cnpg.rs b/tembo-operator/src/cloudnativepg/cnpg.rs index 120ad79ec..88708b575 100644 --- a/tembo-operator/src/cloudnativepg/cnpg.rs +++ b/tembo-operator/src/cloudnativepg/cnpg.rs @@ -3499,7 +3499,7 @@ mod tests { enable_volume_snapshot: true, reconcile_ttl: 30, reconcile_timestamp_ttl: 90, - volume_snapshot_rentention_period: 40, + volume_snapshot_retention_period_days: 40, }; // Test with backups enabled and valid path @@ -3546,7 +3546,7 @@ mod tests { enable_volume_snapshot: false, reconcile_ttl: 30, reconcile_timestamp_ttl: 90, - volume_snapshot_rentention_period: 40, + volume_snapshot_retention_period_days: 40, }; let (backup, template) = cnpg_backup_configuration(&cdb, &cfg_disabled); assert!(backup.is_none()); @@ -3695,7 +3695,7 @@ mod tests { enable_volume_snapshot: true, reconcile_ttl: 30, reconcile_timestamp_ttl: 90, - volume_snapshot_rentention_period: 40, + volume_snapshot_retention_period_days: 40, }; // Test with backups enabled and valid path @@ -3750,7 +3750,7 @@ mod tests { enable_volume_snapshot: false, reconcile_ttl: 30, reconcile_timestamp_ttl: 90, - volume_snapshot_rentention_period: 40, + volume_snapshot_retention_period_days: 40, }; let (backup, template) = cnpg_backup_configuration(&cdb, &cfg_disabled); assert!(backup.is_none()); diff --git a/tembo-operator/src/config.rs b/tembo-operator/src/config.rs index 9c65d001b..7852de7c8 100644 --- a/tembo-operator/src/config.rs +++ b/tembo-operator/src/config.rs @@ -4,7 +4,7 @@ use std::env; pub struct Config { pub enable_backup: bool, pub enable_volume_snapshot: bool, - pub volume_snapshot_rentention_period: u64, + pub volume_snapshot_retention_period_days: u64, pub reconcile_timestamp_ttl: u64, pub reconcile_ttl: u64, } @@ -16,8 +16,8 @@ impl Default for Config { enable_volume_snapshot: from_env_default("ENABLE_VOLUME_SNAPSHOT", "false") .parse() .unwrap(), - volume_snapshot_rentention_period: from_env_default( - "VOLUME_SNAPSHOT_RETENTION_PERIOD", + volume_snapshot_retention_period_days: from_env_default( + "VOLUME_SNAPSHOT_RETENTION_PERIOD_DAYS", "40", ) .parse() diff --git a/tembo-operator/src/controller.rs b/tembo-operator/src/controller.rs index 3e5f7f4c9..7afe35740 100644 --- a/tembo-operator/src/controller.rs +++ b/tembo-operator/src/controller.rs @@ -426,7 +426,7 @@ impl CoreDB { match cleanup_old_volume_snapshots( self, ctx.clone(), - cfg.volume_snapshot_rentention_period, + cfg.volume_snapshot_retention_period_days, ) .await {