[#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 3bb65ba820
commit 839dead226

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)
}
}