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

Add driver.AddTemplate and driver.RemoveTemplate #179

Merged
merged 5 commits into from
Jan 14, 2022

Conversation

becky-hd
Copy link
Contributor

@becky-hd becky-hd commented Jan 6, 2022

#171
Allow client.AddTemplate calling driver.AddTemplate(*templates.ConstraintTemplate) instead of parsing rego modules and calling driver.PutModules in client.
client.CreateCRD uses the same parsing logic as part of template validation.

@willbeason willbeason self-requested a review January 6, 2022 19:48
constraint/pkg/client/drivers/local/local.go Outdated Show resolved Hide resolved
constraint/pkg/client/drivers/local/local.go Outdated Show resolved Hide resolved
constraint/pkg/client/drivers/local/local.go Outdated Show resolved Hide resolved
constraint/pkg/client/client.go Outdated Show resolved Hide resolved
constraint/pkg/client/client.go Outdated Show resolved Hide resolved
constraint/pkg/client/drivers/interface.go Outdated Show resolved Hide resolved
constraint/pkg/client/drivers/local/local.go Outdated Show resolved Hide resolved
constraint/pkg/client/client.go Outdated Show resolved Hide resolved
constraint/pkg/client/drivers/interface.go Outdated Show resolved Hide resolved
constraint/pkg/client/drivers/local/local.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jan 11, 2022

Codecov Report

Merging #179 (75008b5) into master (4b0a3de) will increase coverage by 0.50%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #179      +/-   ##
==========================================
+ Coverage   45.20%   45.70%   +0.50%     
==========================================
  Files          59       59              
  Lines        2796     2866      +70     
==========================================
+ Hits         1264     1310      +46     
- Misses       1290     1309      +19     
- Partials      242      247       +5     
Flag Coverage Δ
unittests 45.70% <ø> (+0.50%) ⬆️

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

Impacted Files Coverage Δ
...works/constraint/pkg/client/drivers/local/local.go 65.15% <0.00%> (-1.08%) ⬇️
...rks/constraint/pkg/client/drivers/remote/remote.go 29.75% <0.00%> (ø)
...y-agent/frameworks/constraint/pkg/client/client.go 71.06% <0.00%> (+1.22%) ⬆️

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 4b0a3de...75008b5. Read the comment docs.

Signed-off-by: Becky Huang <beckyhd@google.com>
…ng with client.CreateCRD

Signed-off-by: Becky Huang <beckyhd@google.com>
export local.Driver
set Externs for local.Driver within client.init
move local.Driver PutModules and DeleteModules to private, deleted from drivers interface
remove rego validation in client.CreateCRD

Signed-off-by: Becky Huang <beckyhd@google.com>
Signed-off-by: Becky Huang <beckyhd@google.com>
@becky-hd becky-hd force-pushed the 171-addtemplate branch 2 times, most recently from 09c80a4 to dd62459 Compare January 13, 2022 17:45
… logic from client.CeateCRD (open-policy-agent#171)

Signed-off-by: Becky Huang <beckyhd@google.com>
@sozercan
Copy link
Member

@becky-hd looks like Gatekeeper tests are failing, is this expected?

@becky-hd
Copy link
Contributor Author

becky-hd commented Jan 13, 2022

@becky-hd looks like Gatekeeper tests are failing, is this expected?

Yes, this PR removed validation in CreateCRD results some gatekeeper unit test failures. I opened open-policy-agent/gatekeeper#1788 as an immediate followup

Copy link
Member

@ritazh ritazh 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 b0196c3 into open-policy-agent:master Jan 14, 2022
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

5 participants