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 x-kubernetes-preserve-unknown-fields path mismatch #279

Merged
merged 2 commits into from
Dec 21, 2023

Conversation

stefanprodan
Copy link
Owner

@stefanprodan stefanprodan commented Dec 14, 2023

For CRDs with arrays the parentPath function doesn't walk back to the spec, as a workaround, to not miss x-kubernetes-preserve-unknown-fields we do partial matching which could open more fields than desired if the field names overlap.

Fix: #278

@stefanprodan stefanprodan changed the title Add test for CRD with nested preserve unknown fields Fix x-kubernetes-preserve-unknown-fields path mismatch Dec 15, 2023
If an array type is present in the CRD, the `parentPath` function
fails to compose the full path to the spec parent for all fields
declared after the array.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
For CRDs with arrays the `parentPath` function doesn't walk back to the spec.
To not miss `x-kubernetes-preserve-unknown-fields` we do partial matching
which could open more fields than desired if the field names overlap.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
@stefanprodan stefanprodan added the area/engine CUE engine related issues and pull requests label Dec 15, 2023
@stefanprodan stefanprodan merged commit 054ea69 into main Dec 21, 2023
4 checks passed
@stefanprodan stefanprodan deleted the test-nested-spec branch December 21, 2023 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/engine CUE engine related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong cue type: {} when generating vendor crd
1 participant