-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: schema parser improvements for complex CRD patterns
This patch fixes schema validation and expression extraction for CRDs that define schemas like `map[string]struct{properties any}` using a combination of `additionalProperties` and `x-kubernetes-preserve-unknown-fields` vendor extension. this commit improves structured resource parsing to: - safely handle empty/nil schema types with proper length checks - Support `x-kubernetes-preserve-unknown-fields` at any schema level by validating extensions before type checking - Support patterns like `map[string]struct{Properties any}` Example of schemas we parse correctly now: ```yaml resources: additionalProperties: # map[string]->struct properties: properties: # any x-kubernetes-preserve-unknown-fields: true ``` links: - https://github.com/pulumi/pulumi-kubernetes-operator/blob/master/operator/api/pulumi/v1/program_types.go#L64-L82 - https://github.com/pulumi/pulumi-kubernetes-operator/blob/master/operator/config/crd/bases/pulumi.com_programs.yaml
- Loading branch information
Showing
2 changed files
with
234 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters