Compare commits

..

2 Commits

Author SHA1 Message Date
Gabriele Fedi
d6f2dc9e69
Merge f754429701 into 4a94cb9dae 2026-04-07 07:08:52 +00:00
Gabriele Fedi
f754429701 fix: skip maintainance when not required
Perform maintenance cycle only when the plugin is
enabled for backups and WAL archiving.

Signed-off-by: Gabriele Fedi <gabriele.fedi@enterprisedb.com>
2026-04-07 09:07:34 +02:00

View File

@ -90,17 +90,12 @@ func (c *CatalogMaintenanceRunnable) cycle(ctx context.Context) (time.Duration,
return 0, err
}
enabledForBackups := false
for _, plugin := range cluster.Spec.Plugins {
if plugin.Name == metadata.PluginName && plugin.IsEnabled() {
enabledForBackups = true
break
}
}
enabledPlugins := cnpgv1.GetPluginConfigurationEnabledPluginNames(cluster.Spec.Plugins)
enabledForBackups := slices.Contains(enabledPlugins, metadata.PluginName)
if !enabledForBackups {
contextLogger.Debug("Skipping retention policy" +
" because the plugin is not enabled for backups")
contextLogger.Debug("Skipping maintenance cycle." +
" Plugin is not enabled for backups")
return 0, nil
}