Skip to content

bug: Inconsistent behavior from Harbor API after deleting a retention policy #21783

@rizul2108

Description

@rizul2108

BUG: Inconsistent behavior in Harbor after deleting a retention policy.

Description
When deleting a retention policy using harbor-cli, the retention ID remains associated with the project metadata even after the policy is deleted. This leads to inconsistent behavior from the Harbor API when handling projects with deleted retention policies.

Steps to Reproduce

  1. Create a project asdfghj using harbor-cli. (used the API: createProject)
  2. Add a tag retention rule to the project. (used the API: createRetention)
  3. Delete the retention policy using harbor-cli. (used the API: deleteRetention)
  4. Fetch project details using the Harbor API. (used the API: getProject)

Expected Behavior

  • The retention ID should be removed from the project metadata after the retention policy is deleted.

Actual Behavior

  • The API response for fetching project details still includes the retention ID of the deleted policy.
  • This causes errors when handling projects with deleted retention policies as the retention ID references a non-existent policy.

Possible Cause

  • The retention policy ID is not being properly disassociated from the project metadata after deletion.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions