eacl: Fix bug with casting to ObjectAccessDenied error #553

Merged
fyrchik merged 1 commits from aarifullin/frostfs-node:fix/eacl_errors into master 2023-08-02 07:22:49 +00:00
Collaborator

Signed-off-by: Airat Arifullin a.arifullin@yadro.com

Signed-off-by: Airat Arifullin a.arifullin@yadro.com
aarifullin added the
bug
label 2023-08-01 13:22:41 +00:00
aarifullin changed title from [#xx] eacl: Fix bug with casting to ObjectAccessDenied error to [#553] eacl: Fix bug with casting to ObjectAccessDenied error 2023-08-01 13:22:58 +00:00
aarifullin force-pushed fix/eacl_errors from a1c279cf0c to 5519dfde4f 2023-08-01 13:23:35 +00:00 Compare
aarifullin requested review from storage-core-committers 2023-08-01 13:23:46 +00:00
aarifullin requested review from storage-core-developers 2023-08-01 13:23:47 +00:00
ale64bit approved these changes 2023-08-01 13:29:28 +00:00
@ -0,0 +13,4 @@
var errAccessDenied *apistatus.ObjectAccessDenied
if !errors.As(err, &errAccessDenied) {
Collaborator

require.True(...).
Same below.

`require.True(...)`. Same below.

require.ErrorsAs is also possible

`require.ErrorsAs` is also possible
Poster
Collaborator

Changed to require.ErrorsAs.
To be honest I don't really like message format that require package uses for errors. That's why I initally used t.Fatalf, but I am ok with require.ErrorsAs

Changed to `require.ErrorsAs`. To be honest I don't really like message format that `require` package uses for errors. That's why I initally used `t.Fatalf`, but I am ok with `require.ErrorsAs`
realloc changed title from [#553] eacl: Fix bug with casting to ObjectAccessDenied error to eacl: Fix bug with casting to ObjectAccessDenied error 2023-08-01 13:33:04 +00:00
aarifullin force-pushed fix/eacl_errors from 5519dfde4f to 9c2c8697a5 2023-08-01 13:35:14 +00:00 Compare
aarifullin force-pushed fix/eacl_errors from 9c2c8697a5 to cae3085551 2023-08-01 13:36:11 +00:00 Compare
fyrchik approved these changes 2023-08-01 13:40:36 +00:00
@ -0,0 +19,4 @@
func TestEACLErr(t *testing.T) {
var reqInfo RequestInfo
errAny := apistatus.ObjectNotFound{}

This is not "any error", the most generic would be sth with errors.New I believe

This is not "any error", the most generic would be sth with `errors.New` I believe
Poster
Collaborator

Alright. I think you are right. I needed any error to create the instance :)

UPD: fixed to errors.New

Alright. I think you are right. I needed any error to create the instance :) UPD: fixed to `errors.New`
fyrchik marked this conversation as resolved
aarifullin force-pushed fix/eacl_errors from cae3085551 to 6e69410c17 2023-08-01 13:46:51 +00:00 Compare
acid-ant approved these changes 2023-08-01 13:55:53 +00:00
fyrchik approved these changes 2023-08-01 13:56:25 +00:00
fyrchik merged commit b3695411d9 into master 2023-08-02 07:22:49 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#553
There is no content yet.