Feature: Implement Garbage Collection (GC) Management Commands #624
Feature: Implement Garbage Collection (GC) Management Commands #624intojhanurag wants to merge 27 commits intogoharbor:mainfrom
Conversation
f0bf5bd to
3a348c1
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #624 +/- ##
=========================================
- Coverage 10.99% 7.29% -3.71%
=========================================
Files 173 274 +101
Lines 8671 13429 +4758
=========================================
+ Hits 953 979 +26
- Misses 7612 12341 +4729
- Partials 106 109 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3a348c1 to
c68fc20
Compare
|
Hi! |
3f08684 to
741cc90
Compare
Hey I am working with this from two days . Please give me the chance to implement this :) |
|
No issues, |
|
Also, we use |
Thanks, will take a look ! |
Sorry for that 🥲 |
ae2f328 to
8e030ac
Compare
4cd3d65 to
bb5d2b0
Compare
|
Hey @bupd , Can I get a review on this one ? |
f5bc52a to
403db9b
Compare
|
Do ping me after this is ready for review, from what I can see. Its still being developed |
Hey @NucleoFusion , I added all commands mine and as well as mentioned by you on your issue :) |
qcserestipy
left a comment
There was a problem hiding this comment.
Thanks for the contribution! LGTM, please only address minor changes and make sure merge conflicts are solved.
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
…ommand Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
…pt package Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
- Add FIXME(goharbor#716) comment for client-side GC job filtering in prompt.go - Return error from ViewGCSchedule instead of os.Exit(1) - Return error from UpdateSchedule instead of log.Fatal - Update callers to handle returned errors Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
…os.Exit Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
…C filtering Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
…aily/weekly) Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Signed-off-by: Anurag Ojha <aojharaj2004@gmail.com>
7c5ef97 to
d4de77e
Compare
|
Hey @qcserestipy , I applied all your suggestions. PTAL :) |
Description
Currently, the Harbor CLI lacks support for managing Garbage Collection (GC), which is a key gap compared to the Harbor WebUI. Users must switch to the WebUI to trigger or schedule storage cleanup, breaking the flow for CLI-based administration and automation.
This PR adds full GC management capabilities to the Harbor CLI.
Closed
Proposed Solution
Introduce a new
gccommand group under theSystemgroup with the following sub-commands:harbor gc listList the history of GC executions, including ID, status, dry-run, and start/end time.
--page 2 --page-size 20--sort -creation_time--match job_status=Success: filter gc history by exact match--fuzzy job_name=gc: filter gc history by fuzzy match--range id=1~10: filter gc history by rangeharbor gc scheduleView the current GC schedule (rendered using table view).
harbor gc update-schedule [type]Update the GC schedule. Supported schedule types:
none,hourly,daily,weekly,custom-> Interactive input of user.harbor gc update-schedule customUser will go through the interactive prompt where he will enter the 6-field cron format.
harbor gc runManually trigger a GC job. Supports flags:
--dry-run: Simulate GC without deleting artifacts.--delete-untagged: Delete untagged artifacts (default: true).harbor gc stopharbor gc log [id]Retrieve and display the log for a specific GC execution.
video demo
https://www.loom.com/share/0b068199f6b34f64b290cee2030e0406