Skip to content

Upjet generates CRDs for some nested resources that are too big to apply #346

Description

@humoflife

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions