Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuing Work from #184: add retention command #364

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

rizul2108
Copy link
Contributor

Description

This PR continues the work started by @Althaf66 in #184.

Changes and Fixes:

Incorporating changes suggested by @bupd

@rizul2108
Copy link
Contributor Author

rizul2108 commented Mar 25, 2025

rizul@rizu:~/OSS/harbor-cli$ ./harbor-cli tag retention create
INFO[0036] Added Tag Retention Rule                     
rizul@rizu:~/OSS/harbor-cli$ ./harbor-cli tag retention list --project-name asdfghj
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│  ID             Action         Disabled       Params                    Priority       Scope Selectors                    Tag Selectors                      Template             │
│ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── │
│  0              retain         false          latestPushedK: 2,         0              repository: [{repoMatches   **}]   &{matches {"untagged":true}  **}   latestPushedK        │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
rizul@rizu:~/OSS/harbor-cli$ ./harbor-cli tag retention delete 
INFO[0010] retention rule deleted successfully          
INFO[0010] Retention Policy deleted successfully        

all 3 are happening smoothly

@rizul2108
Copy link
Contributor Author

rizul2108 commented Mar 25, 2025

BUG: Inconsistent behavior from Harbor API after deleting a retention policy.

  • Created a project asdfghj, added a tag retention rule, and deleted it using harbor-cli.
  • After deletion, one of the APIs correctly reflects the deletion by not showing the retention ID in the project's metadata.
  • However, other APIs still return the retention ID of the deleted policy, causing errors when handling projects with deleted retention policies.

This is error from harbor API side I think.

Signed-off-by: Rizul Gupta <[email protected]>
@Vad1mo
Copy link
Member

Vad1mo commented Mar 25, 2025

BUG: Inconsistent behavior from Harbor API after deleting a retention policy.

  • Created a project asdfghj, added a tag retention rule, and deleted it using harbor-cli.
  • After deletion, one of the APIs correctly reflects the deletion by not showing the retention ID in the project's metadata.
  • However, other APIs still return the retention ID of the deleted policy, causing errors when handling projects with deleted retention policies.

This is error from harbor API side I think.

this seems to be a problem with upstream Harbor. I suggest creating an issue there explaining the problem and referencing it here.

Signed-off-by: Rizul Gupta <[email protected]>
@rizul2108
Copy link
Contributor Author

@bupd the login is failing here also like i mentioned I am not able to login on website also
the login API is not working I think can you please check if it working for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants