-
Notifications
You must be signed in to change notification settings - Fork 29
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
[K8s Contrib CRD] CRD conversion fails if enum is used #24
Comments
I stumbled upon the same issue. Also, the same exception is raised if apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
spec:
group: foo.example.com
names:
kind: Foo
plural: foos
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
properties:
doesntwork:
default: foo
type: string
type: object
served: true
storage: true |
I think I stumbled into this as well; thank you for tracking it down and your fix makes sense to me |
Is this fixed with #29? |
Yep, looks like this is now working with k8s.contrib.crd 1.0.1 :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If a CRD uses an
enum
, k8s.contrib.crd will fail, and with a rather unhelpful error message to the user:Manually parsing and then calling deep to typed on the offending CRD (but without the type union used by k8s.contrib.crd) lead to a slightly better error message:
Which eventually lead me to the offending property, which is
enum
as defined here https://github.com/apple/pkl-k8s/blob/main/generated-package/apiextensions-apiserver/pkg/apis/apiextensions/v1/CustomResourceDefinition.pkl#L272 (there's also two other properties in there that use the typeAny
:default
andexample
)An example minimal CRD which reproduces the issue:
The text was updated successfully, but these errors were encountered: