-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Proposed Changes: This PR significantly enhances the underlying code generation logic by leveraging the Pulumi Kubernetes provider’s advanced schema generation capabilities. The Kubernetes provider’s schema generation has been thoroughly tested over multiple Kubernetes version releases, and used in production environments, making it a robust solution. By adopting this approach, we can efficiently resolve several codegen related bugs in `crd2pulumi` without needing numerous fragile targeted fixes within the current codebase. ### Technical Changes - Removed manual parsing of CRD manifests. - Integrated Pulumi Kubernetes provider's schema generation logic: - CRD manifests are now converted to OpenAPI specs before being schematized. - Inline nested objects within CRDs are now treated as global objects in the OpenAPI layer, simplifying handling and reducing code complexity. - Updated mocked CRDs to be valid for testing, as valid CRDs are required for OpenAPI conversion. - Expanded e2e tests by adding additional CRDs to be code generated, and adding compilation steps for Go, Node, and Dotnet languages to ensure validity. ### User Facing Changes This PR maintains backward compatibility as much as possible, though some behavior changes are expected: 1. CRDs provided to crd2pulumi must be valid and acceptable by a Kubernetes API server. Previous versions made best-effort conversions regardless of validity. 2. Generated Go code now adheres to the `--goPath` flag if provided, ensuring code is generated at the specified path, aligning Go with other languages in terms of folder structure. 3. While we’ve made efforts to maintain consistency, field names and resource names in generated Pulumi code may change slightly due to cross-language sanitization of field and resource names. ### Related Issues Resolves #142, resolves #141, resolves #115, resolves #113, resolves #110, resolves #104, resolves #103, resolves #100, resolves #97, resolves #89, resolves #70, resolves #49, resolves #34, resolves #30, resolves #26, resolves #21, resolves #111, resolves #50
- Loading branch information
Showing
18 changed files
with
792 additions
and
396 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
Oops, something went wrong.