@@ -29,9 +29,8 @@ import (
2929// be read or when the enforcement process failed
3030const defaultRetentionPolicyInterval = time .Minute * 5
3131
32- // RetentionPolicyRunnable executes the retention policy described
33- // in the BarmanObjectStore object periodically.
34- type RetentionPolicyRunnable struct {
32+ // CatalogMaintenanceRunnable executes all the barman catalog maintenance operations
33+ type CatalogMaintenanceRunnable struct {
3534 Client client.Client
3635 Recorder record.EventRecorder
3736 ClusterKey types.NamespacedName
@@ -40,7 +39,7 @@ type RetentionPolicyRunnable struct {
4039
4140// Start enforces the backup retention policies periodically, using the
4241// period specified in the BarmanObjectStore object
43- func (c * RetentionPolicyRunnable ) Start (ctx context.Context ) error {
42+ func (c * CatalogMaintenanceRunnable ) Start (ctx context.Context ) error {
4443 contextLogger := log .FromContext (ctx )
4544 contextLogger .Info ("Starting retention policy runnable" )
4645
@@ -65,7 +64,7 @@ func (c *RetentionPolicyRunnable) Start(ctx context.Context) error {
6564
6665// cycle enforces the retention policies. On success, it returns the amount
6766// of time to wait to the next check.
68- func (c * RetentionPolicyRunnable ) cycle (ctx context.Context ) (time.Duration , error ) {
67+ func (c * CatalogMaintenanceRunnable ) cycle (ctx context.Context ) (time.Duration , error ) {
6968 var cluster cnpgv1.Cluster
7069 var barmanObjectStore barmancloudv1.ObjectStore
7170
@@ -89,7 +88,7 @@ func (c *RetentionPolicyRunnable) cycle(ctx context.Context) (time.Duration, err
8988
9089// applyRetentionPolicy applies the retention policy to the object
9190// store and deletes the stale Kubernetes backup objects.
92- func (c * RetentionPolicyRunnable ) applyRetentionPolicy (
91+ func (c * CatalogMaintenanceRunnable ) applyRetentionPolicy (
9392 ctx context.Context ,
9493 cluster * cnpgv1.Cluster ,
9594 objectStore * barmancloudv1.ObjectStore ,
@@ -156,7 +155,7 @@ func (c *RetentionPolicyRunnable) applyRetentionPolicy(
156155
157156// updateRecoveryWindow updates the recovery window inside the object
158157// store status subresource
159- func (c * RetentionPolicyRunnable ) updateRecoveryWindow (
158+ func (c * CatalogMaintenanceRunnable ) updateRecoveryWindow (
160159 ctx context.Context ,
161160 backupList * catalog.Catalog ,
162161 objectStore * barmancloudv1.ObjectStore ,
0 commit comments