mirror of
https://github.com/goharbor/harbor
synced 2024-09-20 14:35:34 +00:00
Update robot account to skip NotFoundErr (#18321)
Fix #18320 Signed-off-by: Yang Jiao <jiaoya@vmware.com>
This commit is contained in:
parent
2c287cf27a
commit
fecee37439
|
@ -152,7 +152,7 @@ func (d *controller) Update(ctx context.Context, r *Robot, option *Option) error
|
||||||
}
|
}
|
||||||
// update the permission
|
// update the permission
|
||||||
if option != nil && option.WithPermission {
|
if option != nil && option.WithPermission {
|
||||||
if err := d.rbacMgr.DeletePermissionsByRole(ctx, ROBOTTYPE, r.ID); err != nil {
|
if err := d.rbacMgr.DeletePermissionsByRole(ctx, ROBOTTYPE, r.ID); err != nil && !errors.IsNotFoundErr(err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := d.createPermission(ctx, r); err != nil {
|
if err := d.createPermission(ctx, r); err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user