Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions central/pruning/pruning.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,10 @@
func (g *garbageCollectorImpl) collectImages(config *storage.PrivateConfig) {
defer metrics.SetPruningDuration(time.Now(), "Images")
pruneImageAfterDays := config.GetImageRetentionDurationDays()
if pruneImageAfterDays == 0 {
log.Info("[Image Pruning] pruning is disabled.")
return
}

Check warning on line 595 in central/pruning/pruning.go

View check run for this annotation

Codecov / codecov/patch

central/pruning/pruning.go#L593-L595

Added lines #L593 - L595 were not covered by tests
qb := search.NewQueryBuilder().AddDays(search.LastUpdatedTime, int64(pruneImageAfterDays)).ProtoQuery()
imageResults, err := g.images.Search(pruningCtx, qb)
if err != nil {
Expand Down
Loading