Skip to content

Commit

Permalink
chore: fix exited container check filter
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Oct 8, 2024
1 parent c482341 commit a9df02b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docker-host/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ var removeExitedSchedule = machineryvars.GetEnv("REMOVE_EXITED_SCHEDULE", "22 */
var updateImagesSchedule = machineryvars.GetEnv("UPDATE_IMAGES_SCHEDULE", "*/15 * * * *")
var pruneImagesUntil = machineryvars.GetEnv("PRUNE_IMAGES_UNTIL", "168h")
var pruneBuilderCacheUntil = machineryvars.GetEnv("PRUNE_BUILDER_CACHE_UNTIL", "168h")
var removeExitedUntil = machineryvars.GetEnv("REMOVE_EXITED_UNTIL", "168h")

func main() {
cli, err := client.NewClientWithOpts(
Expand Down Expand Up @@ -140,7 +139,10 @@ func removeExited(client *client.Client, c *cron.Cron) {
log.Println("Starting removeExited")
ctx := context.Background()
statusFilter := filters.NewArgs()
statusFilter.Add("until", removeExitedUntil)
statusFilter.Add("status", "paused")
statusFilter.Add("status", "exited")
statusFilter.Add("status", "dead")
statusFilter.Add("status", "created")
containers, err := client.ContainerList(ctx, container.ListOptions{
Filters: statusFilter,
})
Expand Down

0 comments on commit a9df02b

Please sign in to comment.