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

Create CRDs with schema #7308

Merged
merged 1 commit into from
Apr 28, 2023
Merged

Create CRDs with schema #7308

merged 1 commit into from
Apr 28, 2023

Conversation

brandond
Copy link
Member

@brandond brandond commented Apr 18, 2023

Proposed Changes

Fixes an issue where CRDs were being created without schema, allowing resources with invalid content to be created, later stalling the controller ListWatch event channel when the invalid resources could not be deserialized, as discussed at k3s-io/helm-controller#172

This matches the behavior observed by the helm-controller when run standalone:
https://github.com/k3s-io/helm-controller/blob/a14e7f478f924eeb79df9e8e3c102962dab55091/main.go#L58

This also requires moving Addon GVK tracking from a status field to an annotation, as the GroupVersionKind type has special handling internal to Kubernetes that prevents it from being serialized to the resource when schema validation is enabled.

Currently blocked on a Wrangler bug that breaks IntOrString fields:

Types of Changes

bugfix

Verification

See linked issue

Testing

Linked Issues

User-Facing Change

Fixed an issue where Addon, HelmChart, and HelmChartConfig CRDs were created without structural schema, allowing the creation of custom resources of these types with invalid content.

Further Comments

@brandond brandond marked this pull request as ready for review April 18, 2023 20:59
@brandond brandond requested a review from a team as a code owner April 18, 2023 20:59
@brandond brandond force-pushed the fix-crd-schema branch 2 times, most recently from 7e26671 to 4574e35 Compare April 18, 2023 23:42
@brandond brandond marked this pull request as draft April 19, 2023 02:06
@brandond brandond marked this pull request as ready for review April 19, 2023 19:08
Fixes an issue where CRDs were being created without schema, allowing
resources with invalid content to be created, later stalling the
controller ListWatch event channel when the invalid resources could not
be deserialized.

This also requires moving Addon GVK tracking from a status field to
an annotation, as the GroupVersionKind type has special handling
internal to Kubernetes that prevents it from being serialized to the CRD
when schema validation is enabled.

Signed-off-by: Brad Davidson <[email protected]>
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.

4 participants