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

Provide IsUnrecognizedConstraintError #162

Merged
merged 1 commit into from
Nov 23, 2021

Conversation

willbeason
Copy link
Member

For decoupling frameworks and gatekeeper error handling
(which allows using go113 error conventinos in tests), I need to remove
the dependence of gatekeeper on error types defined in frameworks so
these may be changed safely to raw errors (where reasonable to do so).

As an intermediate, I'm adding this function so that gatekeeper can
continue to compile, and the implementation of this method may be
switched out in frameworks.

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

For decoupling frameworks and gatekeeper error handling
(which allows using go113 error conventinos in tests), I need to remove
the dependence of gatekeeper on error types defined in frameworks so
these may be changed safely to raw errors (where reasonable to do so).

As an intermediate, I'm adding this function so that gatekeeper can
continue to compile, and the implementation of this method may be
switched out in frameworks.

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

This is safe since gatekeeper doesn't actually use the type; it just performs a type check.

@codecov-commenter
Copy link

Codecov Report

Merging #162 (7700b8e) into master (8b4a99a) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #162      +/-   ##
==========================================
- Coverage   43.97%   43.95%   -0.03%     
==========================================
  Files          56       56              
  Lines        3131     3133       +2     
==========================================
  Hits         1377     1377              
- Misses       1379     1381       +2     
  Partials      375      375              
Flag Coverage Δ
unittests 43.95% <ø> (-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/errors.go 44.44% <0.00%> (-5.56%) ⬇️

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 8b4a99a...7700b8e. 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

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 de4fe6e into open-policy-agent:master Nov 23, 2021
@willbeason willbeason deleted the decouple branch November 23, 2021 15:26
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.

None yet

4 participants