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
Bugfix: CRD's openapi schema extension cannot be properly serialized #1804
Bugfix: CRD's openapi schema extension cannot be properly serialized #1804
Conversation
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.
Yaml.dump() is still not working properly,it will serialize field "x-kubernetes-int-or-string" to
"xKubernetesIntOrString" and "x-kubernetes-int-or-string" like this:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: crontabs.stable.example.com
spec:
group: stable.example.com
names:
kind: CronTab
plural: crontabs
shortNames:
- ct
singular: crontab
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
type: object
properties:
foo:
anyOf:
- type: integer
- type: string
pattern: ^.*
x-kubernetes-int-or-string: true
+ xKubernetesIntOrString: true
spec:
type: object
properties:
cronSpec:
type: string
image:
type: string
replicas:
type: integer
served: true
storage: true
7f391cf
to
287455c
Compare
@NeverRaR nice catch, i fixed CRD dumping in the latest commit |
representer.addTypeDescription(desc); | ||
} | ||
|
||
private static TypeDescription substitudePropertiesWithGsonAnnotation( |
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.
Maybe substitute?
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.
yep nailed typo
This looks good to me, but waiting for @NeverRaR to lgtm also. |
287455c
to
2225ead
Compare
/lgtm |
@NeverRaR: changing LGTM is restricted to collaborators In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
2225ead
to
e5b1341
Compare
lgtm |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, yue9944882 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes: #1796
this pull allows the yaml serializer to have similar behavior as gson's
@SerializedName
annotation by registering additional type descriptions.and i will pick it to past releases after merged, as it's breaking all CRDs w/ the openapi extension.
cc @brendandburns