feat: Added retention command#184
Conversation
Signed-off-by: ALTHAF <althafasharaf02@gmail.com>
Signed-off-by: ALTHAF <althafasharaf02@gmail.com>
|
Is there anything preventing this from being merged? (Except for the merge conflict) |
bupd
left a comment
There was a problem hiding this comment.
Overall, Retention should be a subcommand of project or tag.
I believe it is better to have it as subcommand for tag. Since we also have tag immutability rules.
Example use case:
./harbor tag retention --projectname ...flags./harbor tag immutable --projectname ...flagsThe above would make much sense from a user perspective. Which is also clear to the user.
| cmd := &cobra.Command{ | ||
| Use: "retention", | ||
| Short: "Manage retention rule in the project", | ||
| Long: `Manage retention rules in the project in Harbor`, |
There was a problem hiding this comment.
We can use the Long explanation to explain what does this command do.
Since retention is a TAG RETENTION policy, we should communicate this well to the user.
There was a problem hiding this comment.
Also mention, "user can only create 15 tag retention rules per project".
| Use: "retention", | ||
| Short: "Manage retention rule in the project", | ||
| Long: `Manage retention rules in the project in Harbor`, | ||
| Example: `harbor retention create`, |
There was a problem hiding this comment.
some example usecases here would be beneficial.
| func ListExecutionRetentionCommand() *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "list", | ||
| Short: "list retention execution of the project", |
There was a problem hiding this comment.
This is an absolute wrong approach here.
As an user I would expect
./harbor project retention listto return me the list of retention rules that I made. Instead of retention executions.
FIX THIS.
| Use: "list", | ||
| Short: "list retention execution of the project", |
There was a problem hiding this comment.
This is absolute wrong approach here.
As an user I would expect
./harbor tag retention listto return me the list of retention rules that I made. Instead of retention executions.
FIX THIS.
|
@Althaf66 Will you work further on this issue or should I continue from here? |
|
You can work on this issue. |
Added new retention commands
harbor retention create- create retention policy for the projectharbor retention list- list retention execution for the projectharbor retention delete- delete retention policy for the projectthis PR fixes part of #94