refactor: encapsulate ImageIDs to WLIDs map - #93
Merged
Conversation
This data structure is designed to replace the map-and-mutex that are side-by-side in the WatchHandler so clients can perform thread-safe operations on it with more confidence and ease. Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
As the first step in wiring the refactoring, use the IWMap in WatchHandler’s private functions that previously handled thread-safe operations on the raw ImageIDs to WLIDs map Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
The data structure maps image hashes to WLIDs. Image hashes are not the same as image IDs. Image hashes are plain hash digest values. Rename mentions to avoid confusion. Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
vladklokun
force-pushed
the
refactor-iwmap
branch
from
March 24, 2023 18:50
9c2e61a to
80e35d5
Compare
vladklokun
marked this pull request as ready for review
March 24, 2023 18:52
Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
5 tasks
dwertent
approved these changes
Mar 26, 2023
dwertent
left a comment
There was a problem hiding this comment.
Well done. I liked the refactoring you did with the lock and unlock :)
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.
Overview
This PR encapsulates a map-and-mutex map of Image hashes to WLIDs in a thread-safe map-like type, so that they can be accessed more conveniently, with less leeway to break synchronization.
How to Test
To check unit tests, run:
Other than that, run whatever Operator flows you deem necessary.
Checklist before requesting a review