This patch release backports a feature to fix a category of bugs in the providers to the release-1.10 branch that lets upjet-based providers override the controller setup aggregator and resource.Terraformed templates. It unblocks providers from resolving a categorical bug involving a map in status.atProvider by supplying their own terraformed template.
Features
-
Custom controller setup aggregator & terraformed templates (#696, backport of #693): Adds the
config.WithSetupAggregatorTemplateandconfig.WithTerraformedTemplateProviderOptions, mirroring the existingconfig.WithMainTemplateandWithControllerTemplateoptions. These let a provider override the controller setup aggregator (setup.go.tmpl) and the managed-resource terraformed (terraformed.go.tmpl) templates used during code generation. The change is backward-compatible: when a provider does not set these options, upjet's built-in default templates are used. Note that a provider adopting these APIs takes over ownership of the corresponding template and becomes responsible for keeping it in sync with future upjet changes. New documentation for both templates and their variables was added underdocs/. -
New
Terraform.ResourceSchematerraformed template variable: The terraformed template now exposes the full Terraform Plugin SDK v2 resource schema (*github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.Resource) asTerraform.ResourceSchema, replacing the previousTerraform.SchemaVersion(int) variable. The default template reads{{ .Terraform.ResourceSchema.SchemaVersion }}to implementGetTerraformSchemaVersion, while a custom terraformed template can read any other exported field of the schema.
What's Changed
- [Backport release-1.10] Allow Custom Controller Setup Aggregator & Terraformed Templates via config.Provider by @ulucinar in #696
Full Changelog: v1.10.3...v1.10.4