goharbor / goharbor/harbor-cli
Implement preheat policy command and refactor instance command structure
- Dominant language
- Go
- Stars
- 163
- Forks
- 211
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
Fixes a part of #94
Currently, the CLI supports P2P preheating incompletely. While we can manage P2P providers via harbor instance, there is no way to create, list, or execute the actual Preheat Policies. This means users can configure a connection to Dragonfly/Kraken but cannot actually tell Harbor what images to send there without switching to the Web UI.
Additionally, the current command structure uses instance as a root command, which is ambiguous (confusing P2P instances with Harbor server instances) and limits our ability to group P2P-related commands logically.
I propose a two-part solution:
1. Refactor Command Structure Move the existing instance command to be a child of a new root command preheat.
Old: harbor instance [command]
New: harbor preheat instance [command]
2. Implement preheat policy(list, create, update, delete, and execute) Command Add a new subcommand policy under the preheat group to manage preheating rules.
or Alternatively we could keep instance as root and add preheat-policy as a separate root command.
I am happy to work on this implementation. Let me know if this approach looks good , and I can start drafting the PR.
@bupd @Vad1mo
Contributor guide
Assessment
This issue has not been assessed yet.