What happened?
When creating a Crossplane provider that wraps a Terraform provider that has nested resource fields, Upjet creates CRDs that are tens of MB big and therefore cannot be kubectl applied. The expected behavior would be to create a CRD within the max size for applying it to Kubernetes, or to find a way to possibly structure it into either multiple CRDs that can each be applied.
How can we reproduce it?
To reproduce this:
- git clone git@github.com:upbound/provider-datadog.git
- git checkout bootstrap
Remove the following lines from function p.AddResourceConfigurator("datadog_dashboard", func(r *config.Resource) in config/dashboard/config.go.
delete(r.TerraformResource.Schema, "widget")
desc, _ := comments.New("widget you want to add to a dashboard",
comments.WithTFTag("-"))
r.TerraformResource.Schema["widget"] = &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: desc.String(),
}
Then run
- make submodules
- make clean; make gen-clean; make generate
- wc package/crds/dashboard.datadog.upbound.io_dashboards.yaml
Observe a CRD size of 19,589,403 bytes.
What happened?
When creating a Crossplane provider that wraps a Terraform provider that has nested resource fields, Upjet creates CRDs that are tens of MB big and therefore cannot be kubectl applied. The expected behavior would be to create a CRD within the max size for applying it to Kubernetes, or to find a way to possibly structure it into either multiple CRDs that can each be applied.
How can we reproduce it?
To reproduce this:
Remove the following lines from function
p.AddResourceConfigurator("datadog_dashboard", func(r *config.Resource)inconfig/dashboard/config.go.Then run
Observe a CRD size of 19,589,403 bytes.