Skip to content
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

perf: Don't cache Constraint status #216

Merged
merged 6 commits into from
Apr 11, 2022

Conversation

willbeason
Copy link
Member

Constraint status is ephemeral and callers should not be relying on our
cached version of the status field. Also, status can be very large, and
caching it wastes space.

Note that the Driver already drops status as it only preserves spec.parameters.

Signed-off-by: Will Beason willbeason@google.com

Fixes #209

Constraint status is ephemeral and callers should not be relying on our
cached version of the status field. Also, status can be very large, and
caching it wastes space.

Signed-off-by: Will Beason <willbeason@google.com>
Signed-off-by: Will Beason <willbeason@google.com>
@codecov-commenter
Copy link

Codecov Report

Merging #216 (2ee2862) into master (7b86d0c) will increase coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #216      +/-   ##
==========================================
+ Coverage   46.29%   46.33%   +0.03%     
==========================================
  Files          64       64              
  Lines        2819     2821       +2     
==========================================
+ Hits         1305     1307       +2     
  Misses       1297     1297              
  Partials      217      217              
Flag Coverage Δ
unittests 46.33% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...y-agent/frameworks/constraint/pkg/client/client.go 87.94% <0.00%> (ø)
...orks/constraint/pkg/client/drivers/local/driver.go 42.33% <0.00%> (ø)
...rameworks/constraint/pkg/client/template_client.go 95.74% <0.00%> (+0.18%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b86d0c...2ee2862. Read the comment docs.

Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

constraint/pkg/client/drivers/local/driver.go Outdated Show resolved Hide resolved
Will Beason added 2 commits April 7, 2022 12:15
Signed-off-by: Will Beason <willbeason@google.com>
Signed-off-by: Will Beason <willbeason@google.com>
Copy link
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@willbeason willbeason merged commit 0684e78 into open-policy-agent:master Apr 11, 2022
@willbeason willbeason deleted the nocache-status branch April 11, 2022 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No Need to Cache Constraint Status
4 participants