[#1297] getSvc: Return AccessDenied instead of ObjectNotFound

Do not replace the access denied error if it was received earlier.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-09-16 12:38:45 +03:00
parent 96308a26c6
commit e7d8b71a36

View file

@ -41,7 +41,7 @@ func (r *request) processNode(ctx context.Context, info client.NodeInfo) bool {
r.status = statusUndefined
if errors.As(err, &errAccessDenied) {
r.err = err
} else {
} else if r.err == nil || !errors.As(r.err, &errAccessDenied) {
r.err = new(apistatus.ObjectNotFound)
}
}