goharbor / goharbor/harbor-cli
feat: Implement Garbage Collection (GC) Management Commands
- Dominant language
- Go
- Stars
- 163
- Forks
- 211
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
### Feature Request
Currently, the Harbor CLI lacks support for managing Garbage Collection (GC). and it is a key gap in achieving parity with the Harbor WebUI. Users currently have to switch to the WebUI to trigger or schedule storage cleanup, which breaks the flow for CLI-based administration and automation.
### Proposed Solution
I propose implementing a new `harbor gc` command group to bring full GC management capabilities to the CLI.
**Proposed Command Structure:**
The new `gc` command will be added to the `System` group with the following sub-commands:
* `harbor gc list`: List the history of GC executions (ID, status, dry-run, start/end time).
* `harbor gc schedule`: View the current GC schedule.
* `harbor gc update-schedule [type]`: Update the GC schedule (supports `hourly`, `daily`, `weekly`, `custom`, and `none`).
* `harbor gc run`: Manually trigger a GC job (with flags for `--dry-run` and `--delete-untagged`).
* `harbor gc log [id]`: Retrieve and view the log for a specific GC execution.
Contributor guide
Assessment
This issue has not been assessed yet.