We are excited to announce the release of Upjet v1.4.0, which includes several enhancements and new features aimed at improving the flexibility, usability, and efficiency of the code generation pipeline and API management. Below are the key updates in this release.
Release Highlights
1. Generate singleton lists as embedded objects
- Terraform configuration blocks with a MaxItems constraint of 1 are now generated as embedded objects in MR APIs instead of lists. This change simplifies updates and patches via SSA by eliminating the need for specific configuration for associative lists.
- Introduced runtime conversion logic to convert embedded objects back to singleton lists for Terraform operations and vice versa for updates to spec.forProvider, status.atProvider, and connection details.
- Added a schema traverser to decouple Terraform schema traversal from various actions, allowing providers to generate singleton lists as embedded objects using the ujconfig.SingletonListEmbedder configuration.
- Supported the generation of new CRD API versions with embedded object schemas while maintaining existing versions.
- For further details: #387
2. Support for specifying the controller reconciliation/watch version
- Added config.Resource.ControllerReconcileVersion to specify the CRD API version that the associated controller will watch and reconcile, preventing unnecessary webhook conversions for multi-versioned CRDs.
- For further details: #400
3. TerraformConversions interface for handling conversions between Crossplane and Terraform
- Introduced config.Resource.TerraformConversions for handling data transformations between Crossplane and Terraform layers. The initial implementation, config.singletonListConversion, manages conversions between singleton lists and embedded objects.
4. Dynamic code generation pipeline for multi-version APIs
- Addressed name conflicts in the code generation pipeline by making it aware of previous CRD versions. This allows dynamic resolution of conflicts when generating new API versions, such as v1beta2, while older versions like v1beta1 exist.
- Deprecated the config.Resource.OverrideFieldNames API in favor of the new config.Resource.PreviousVersions mechanism, ensuring more efficient and dynamic prevention of type name conflicts.
- For further details: #402
5. Support for Secret References in spec.initProvider
- Enabled generation of secret references for sensitive parameters under the spec.initProvider API tree. This allows full specification of sensitive parameters, such as passwords, in the initProvider.
- Adjusted code generation and runtime logic to support secret references from both spec.initProvider and spec.forProvider, with forProvider references taking precedence when conflicts arise.
- For further details: #406
6. Late-Initialization configuration API
- Introduced a new late-init API to skip fields in spec.initProvider that are already filled, preventing the late-init operation in forProvider from overriding these fields. This ensures the integrity and intended configuration of fields specified in initProvider.
- For further details: #407
7. Documentation Improvements
- Improvement on configuring a resource external name document: #392
- Improvement on clarify documentation around reference type name: #393
- Improvement on selector field name documentation: #399
What's Changed
- chore: improve doc about configuring a resource external name by @yordis in #392
- chore: clarify documentation around reference type name by @yordis in #393
- Updates the MPL code used in NOTICE by @jeanduplessis in #394
- chore: improve docs about selector field name by @yordis in #399
- Generate singleton lists as embedded objects by @ulucinar in #387
- Allow Specification of the CRD API Version a Controller Watches & Reconciles by @ulucinar in #400
- Add example converter for conversion of singleton lists to embedded objects by @sergenyalcin in #397
- Add config.Resource.PreviousVersions to specify the previous versions of an MR API by @ulucinar in #402
- Generate Secret References for Sensitive Parameters under the spec.initProvider API tree by @ulucinar in #406
- Add a new late-init configuration to skip already filled field in spec.initProvider by @sergenyalcin in #407
New Contributors
Full Changelog: v1.3.0...v1.4.0