feat: enhance SMD client with membership listing and improve tests for node population - #123
Merged
Merged
Conversation
…r node population Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
…mance tests Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request refactors how group membership data is fetched and handled for nodes in the SMD client, switching from per-node membership API calls to a bulk query. This change improves efficiency by reducing the number of HTTP requests during node population. The update also includes adjustments to tests and the fake client to support and verify the new bulk membership fetching logic.
The most important changes are:
Efficiency and Logic Improvements:
SMDclient.go: Changed group membership fetching inPopulateNodesfrom making individual requests per node to a single bulk/hsm/v2/memberships?type=nodecall, reducing HTTP overhead and improving performance.SMDclient_test.go,SMDclient_performance_test.go: Updated all tests and test servers to expect and handle bulk membership requests instead of per-node requests, ensuring test coverage for the new logic. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]Testing and Validation:
SMDclient_test.go: Added assertions to verify that only the bulk membership endpoint is called and that no per-node membership requests are made during node population.SMDclient_performance_test.go: Added a helper functionbulkMembershipsJSONto generate bulk membership responses for tests and benchmarks, supporting scalable test scenarios.Fake Client Enhancements:
FakeSMDClient.go,FakeSMDClient_test.go: Added aListMembershipsmethod to the fake client to simulate the new bulk membership API, and introduced corresponding tests to validate its behavior. [1] [2]These changes collectively modernize and streamline group membership handling, improving both runtime efficiency and test reliability.
Checklist
make test(or equivalent) locally and all tests passgit commit -s) with my real name and email<filename>.licensesidecarLICENSES/directoryType of Change
For more info, see Contributing Guidelines.