-
Notifications
You must be signed in to change notification settings - Fork 97
fwserver: add list resources to GetMetadata
#1151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e790c83
to
c57458a
Compare
586bdca
to
f971285
Compare
485abb7
to
4dd9564
Compare
4dd9564
to
7a0dfb3
Compare
defer s.listResourceFuncsMutex.Unlock() | ||
|
||
if s.listResourceFuncs != nil { | ||
return s.listResourceFuncs, s.resourceTypesDiags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s.resourceTypesDiags
is the wrong diags here. This is fixed in a follow-up pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything seems to be in order 👍🏽
sort.Slice(response.Resources, func(i int, j int) bool { | ||
return response.Resources[i].TypeName < response.Resources[j].TypeName | ||
}) | ||
|
||
if diff := cmp.Diff(response, testCase.expectedResponse); diff != "" { | ||
opts := cmp.Options{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, what effect does adding this have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test will ignore the difference between []ListResource{}
and nil
. So it ignores the difference between the empty slice that GetMetadata
returns by default and the default zero value for GetMetadataResponse.ListResources
.
So the effect is: no need to add []ListResource{}
to every test.
Description
This pull request adds list resource metadata to the protocol-independent framework server implementation of
GetMetadata
.Rollback Plan
Changes to Security Controls
No