goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.
https://goharbor.io
Apache License 2.0
24.3k stars 4.77k forks source link

GC - Artifacts uploaded in the past 2 hours NOT are excluded #21266

Open antoinesax opened 1 day ago

antoinesax commented 1 day ago

Expected behavior and actual behavior: We are running shceduled GC every 1h, as per documentation Artifacts uploaded in the past 2 hours(the default window) are excluded from garbage collection. But actually, they are not excluded.

Steps to reproduce the problem: Push an untagged image to the registry. Perform GC just after this, it will delete the image

Versions: Harbor, Version v2.10.2-1a741cb7, running in a K3s cluster.

Jellyfrog commented 1 day ago

Same with 2.12.0

chlins commented 20 hours ago

Could you check the environment variable GC_TIME_WINDOW_HOURS in the core container?

antoinesax commented 14 hours ago
harbor [ /harbor ]$ env | grep GC_TIME_WINDOW_HOURS
harbor [ /harbor ]$

It's not present