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

Upgrade constrainttemplate_controller to apiextensionsv1 #1320

Conversation

julianKatz
Copy link
Contributor

This PR changes constrainttemplate_controller to use apiextensionsv1 to
create Constraint kind v1 CRDs. That change revealed some additional
problems. In particular, that byPod status was being pruned by the API
server. This required a fix in Constraint Framework.

open-policy-agent/frameworks#120 adds a status field to the Constraint
kind CRD. This allows Gatekeeper to add byPodStatus to the object.

This PR imports this new code and updates some tests.

Contributes to #550

Signed-off-by: juliankatz juliankatz@google.com

@julianKatz julianKatz force-pushed the switch-libraries-to-apiextensionsv1 branch from 39be7e3 to 874ebcb Compare May 22, 2021 00:36
@codecov-commenter
Copy link

codecov-commenter commented May 22, 2021

Codecov Report

Merging #1320 (cb32f87) into master (edb29d0) will increase coverage by 10.99%.
The diff coverage is 80.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1320       +/-   ##
===========================================
+ Coverage   48.60%   59.60%   +10.99%     
===========================================
  Files          68        2       -66     
  Lines        4890      354     -4536     
===========================================
- Hits         2377      211     -2166     
+ Misses       2162      101     -2061     
+ Partials      351       42      -309     
Flag Coverage Δ
unittests 59.60% <80.00%> (+10.99%) ⬆️

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

Impacted Files Coverage Δ
...onstrainttemplate/constrainttemplate_controller.go 57.28% <80.00%> (+0.32%) ⬆️
pkg/watch/registrar.go
pkg/metrics/exporter.go
pkg/metrics/record.go
pkg/syncutil/syncbool.go
pkg/mutation/system.go
pkg/controller/sync/sync_controller.go
pkg/readiness/noop_expectations.go
pkg/util/enforcement_action.go
pkg/mutation/path/tester/tester.go
... and 58 more

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 edb29d0...cb32f87. Read the comment docs.

@julianKatz julianKatz force-pushed the switch-libraries-to-apiextensionsv1 branch from 874ebcb to 1e446a6 Compare May 22, 2021 00:40
@julianKatz
Copy link
Contributor Author

The e2e tests that are failing here are failing for other PRs as well.

@ritazh
Copy link
Member

ritazh commented May 22, 2021

#1321 fixes the e2e. pls rebase

@julianKatz julianKatz force-pushed the switch-libraries-to-apiextensionsv1 branch from cb32f87 to fde524c Compare May 24, 2021 17:40
@julianKatz
Copy link
Contributor Author

#1321 fixes the e2e. pls rebase

Done! Thanks for fixing that

Makefile Outdated Show resolved Hide resolved
@julianKatz julianKatz force-pushed the switch-libraries-to-apiextensionsv1 branch 2 times, most recently from 72ba0d7 to 52d3d91 Compare May 24, 2021 20:15
@julianKatz julianKatz requested a review from maxsmythe May 24, 2021 20:53
This PR changes constrainttemplate_controller to use apiextensionsv1 to
create Constraint kind v1 CRDs.  That change revealed some additional
problems.  In particular, that byPod status was being pruned by the API
server.  This required a fix in Constraint Framework.

open-policy-agent/frameworks#120 adds a status field to the Constraint
kind CRD.  This allows Gatekeeper to add byPodStatus to the object.

This PR imports this new code and updates some tests.

Contributes to open-policy-agent#550

Signed-off-by: juliankatz <juliankatz@google.com>
@julianKatz julianKatz force-pushed the switch-libraries-to-apiextensionsv1 branch from 52d3d91 to 0489c31 Compare May 24, 2021 21:28
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

@maxsmythe maxsmythe merged commit 0b1d89d into open-policy-agent:master May 25, 2021
@julianKatz julianKatz deleted the switch-libraries-to-apiextensionsv1 branch May 25, 2021 16:33
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