Upjet generates CRDs for some nested resources that are too big to apply
- Dominant language
- Go
- Stars
- 481
- Forks
- 131
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 11
Description
### 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.
Contributor guide
Assessment
This issue has not been assessed yet.