-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add two caching modes #91
Conversation
75ab9dc
to
40cce6f
Compare
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.
Looks good overall to me! There isn't even too much that I need clarification on, although I have the advantage of you walking me through it last week.
74891a9
to
2d4f766
Compare
The default caching mode is one that caches objects for the duration of the ResolveTemplate execution. This mode is not completely concurrency safe. The advanced caching mode is concurrency safe and utilizes watches to update the cache in background goroutines. The resolve options are now passed to the ResolveTemplate method. This allows a shared resolver to resolve templates for different propagated policies. This allows the cache to be shared as well. Relates: https://issues.redhat.com/browse/ACM-7398 Signed-off-by: mprahl <mprahl@users.noreply.github.com>
Signed-off-by: mprahl <mprahl@users.noreply.github.com>
This is useful in the OCM Policy Propagator, where the ManagedClusterLabels variable is set from the ManagedCluster object the replicated policy is being built for. Signed-off-by: mprahl <mprahl@users.noreply.github.com>
Signed-off-by: mprahl <mprahl@users.noreply.github.com>
Kudos, SonarCloud Quality Gate passed! |
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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JustinKuli, mprahl The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
See each commit for changes.
The default caching mode is one that caches objects for the duration of the ResolveTemplate execution. This mode is not completely concurrency safe.
The advanced caching mode is concurrency safe and utilizes watches to update the cache in background goroutines.
Relates:
https://issues.redhat.com/browse/ACM-7398