Skip to content

Commit

Permalink
fix: fix the update of retention policy (goharbor#17064)
Browse files Browse the repository at this point in the history
Signed-off-by: chlins <chenyuzh@vmware.com>
  • Loading branch information
chlins authored and sluetze committed Oct 29, 2022
1 parent d3c993b commit 95c2796
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server/v2.0/handler/retention.go
Expand Up @@ -384,10 +384,10 @@ func (r *retentionAPI) requirePolicyAccess(ctx context.Context, p *policy.Metada
// validate
if len(meta["retention_id"]) > 0 {
// return err if retention id does not match
if meta["retention_id"] != fmt.Sprintf("%d", p.ID) {
return errors.NotFoundError(errors.Errorf("the retention policy id %d does not match", p.ID))
if meta["retention_id"] == fmt.Sprintf("%d", p.ID) {
return nil
}
}

return nil
return errors.NotFoundError(errors.Errorf("the retention policy id %d does not match", p.ID))
}

0 comments on commit 95c2796

Please sign in to comment.