-
Notifications
You must be signed in to change notification settings - Fork 782
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
chore: update opa v1 with v0 rego compat #3798
Conversation
Signed-off-by: Sertac Ozercan <[email protected]>
@@ -222,6 +222,7 @@ func (d *Driver) eval(ctx context.Context, compiler *ast.Compiler, target string | |||
rego.Query(queryPath.String()), | |||
rego.EnablePrintStatements(d.printEnabled), | |||
rego.PrintHook(d.printHook), | |||
rego.SetRegoVersion(ast.RegoV0), |
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.
TODO: this will need to be updated in frameworks
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.
Signed-off-by: Sertac Ozercan <[email protected]>
Signed-off-by: Sertac Ozercan <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3798 +/- ##
==========================================
- Coverage 54.49% 47.77% -6.73%
==========================================
Files 134 235 +101
Lines 12329 19861 +7532
==========================================
+ Hits 6719 9488 +2769
- Misses 5116 9485 +4369
- Partials 494 888 +394
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Sertac Ozercan <[email protected]>
Signed-off-by: Sertac Ozercan <[email protected]>
Signed-off-by: Sertac Ozercan <[email protected]>
Thanks @sozercan I verified the library with gator and everything works as expected. Here is the log -
|
Signed-off-by: Sertac Ozercan <[email protected]>
Signed-off-by: Sertac Ozercan <[email protected]>
pkg/drivers/k8scel/driver.go
Outdated
@@ -15,7 +15,7 @@ import ( | |||
"github.com/open-policy-agent/frameworks/constraint/pkg/types" | |||
pSchema "github.com/open-policy-agent/gatekeeper/v3/pkg/drivers/k8scel/schema" | |||
"github.com/open-policy-agent/gatekeeper/v3/pkg/drivers/k8scel/transform" | |||
"github.com/open-policy-agent/opa/storage" |
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.
does using v1/storage satisfy the interface? IIRC, constraint framework change is pointing to v0 to start.
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.
reverted this to be consistent with frameworks
@@ -71,7 +71,7 @@ func (img image) newMutatedImage(domain, path, tag string) image { | |||
} | |||
|
|||
// ignoreUnset returns `new` if `new` is set, otherwise it returns `old`. | |||
func ignoreUnset(old, new string) string { | |||
func ignoreUnset(old, new string) string { // nolint:revive |
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.
same
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.
what do you mean? this is due to revive linter rule redefines-builtin-id: redefinition of the built-in function new'
. since this is a single occurance, i added a nolint
here
Signed-off-by: Sertac Ozercan <[email protected]>
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
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
What this PR does / why we need it:
quick update to test updating opa v1.0 with v0 compat
Which issue(s) this PR fixes (optional, using
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when the PR gets merged):Fixes #
Special notes for your reviewer:
Merge after open-policy-agent/frameworks#518