-
Notifications
You must be signed in to change notification settings - Fork 49
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
ConstraintTemplate versions use apiextensionsv1 #123
ConstraintTemplate versions use apiextensionsv1 #123
Conversation
Previously, I left ConstraintTemplate (CT) versions v1alpha1 and v1beta1 using apiextensionsv1beta1.JSONSchemaProps. I thought this appropriate, given that was what they were previously implemented as. v1 CT, on the other hand, would use v1beta1 JSONSchemaProps. This turns out to be a bad idea. Any logic we write that interacts with OpenAPIV3Schema in a CT's Validation section is forced to interact with OpenAPIV3Schema's type. Before this PR, that type is apiextensionsv1beta1.JSONSchemaProps. This makes our life difficult, as v1 CT's version of this variable will have a different type. This would then require us to re-implement any logic for this section to implement a second type, or to do some gross conversions. Further, apiextensionsv1beta1 will be removed from k8s.io/apiextensions-apiserver, preventing us from upgrading that library without doing this work. Basically, this change is unavoidable and appropriate. This blocks open-policy-agent#121 Contributes to open-policy-agent/gatekeeper#550 Signed-off-by: juliankatz <juliankatz@google.com>
88ba532
to
04f102c
Compare
Codecov Report
@@ Coverage Diff @@
## master #123 +/- ##
=======================================
Coverage 44.26% 44.26%
=======================================
Files 30 30
Lines 2417 2417
=======================================
Hits 1070 1070
Misses 1022 1022
Partials 325 325
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
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.
|
|
@ritazh What version of
|
@julianKatz it's showing |
Previously, I left ConstraintTemplate (CT) versions v1alpha1 and v1beta1
using apiextensionsv1beta1.JSONSchemaProps. I thought this appropriate,
given that was what they were previously implemented as. v1 CT, on the
other hand, would use v1beta1 JSONSchemaProps.
This turns out to be a bad idea.
Any logic we write that interacts with OpenAPIV3Schema in a CT's
Validation section is forced to interact with OpenAPIV3Schema's type.
Before this PR, that type is apiextensionsv1beta1.JSONSchemaProps. This
makes our life difficult, as v1 CT's version of this variable will have
a different type. This would then require us to re-implement any logic
for this section to implement a second type, or to do some gross
conversions.
Further, apiextensionsv1beta1 will be removed from
k8s.io/apiextensions-apiserver, preventing us from upgrading that
library without doing this work.
Basically, this change is unavoidable and appropriate.
This blocks #121
Contributes to open-policy-agent/gatekeeper#550
Signed-off-by: juliankatz juliankatz@google.com