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

Fix schema generation for IntOrString #298

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

brandond
Copy link
Member

@brandond brandond commented Apr 19, 2023

The IntOrString type is currently generated as a string, which is incorrect. It should use the XIntOrString bool to specify that either integer or string values are allowed.

Ref: https://github.com/kubernetes/apiextensions-apiserver/blob/v0.24.0/pkg/apis/apiextensions/v1/types_jsonschema.go#L107-L120

There was even a TODO in the code for fixing this once apiextensions hit v1.

Issue Description

Fixes an issue where IntOrString fields with integer values are rejected with messages like:

The HelmChart "cert-manager" is invalid: spec.set.webhook.timeoutSeconds: Invalid value: "integer": spec.set.webhook.timeoutSeconds in body must be of type string: "integer"

spec.set is an IntOrString field, but the wrangler-generated openapi v3 schema rejects it as described above.

Linked Issue

The IntOrString type is currently generated as a string, which is
incorrect. It should use the XIntOrString bool to specify that either
integer or string values are allowed.

Ref:
* https://github.com/kubernetes/apiextensions-apiserver/blob/v0.24.0/pkg/apis/apiextensions/v1/types_jsonschema.go#L107-L120

Signed-off-by: Brad Davidson <[email protected]>
@brandond brandond mentioned this pull request Apr 19, 2023
1 task
@Oats87 Oats87 requested review from mattfarina and rmweir April 19, 2023 16:24
@brandond brandond merged commit 80fdf09 into rancher:master Apr 19, 2023
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.

3 participants