mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 18:25:56 +01:00
fix: fix the update of retention policy (#17064)
Signed-off-by: chlins <chenyuzh@vmware.com>
This commit is contained in:
parent
b11970ac3c
commit
8e99c83b19
@ -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))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user