[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
humoflife opened this issue Feb 15, 2024 · 0 comments
Open
Labels
bug Something isn't working codegen v2
Milestone

Comments

@humoflife
Copy link

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.

@humoflife humoflife added the bug Something isn't working label Feb 15, 2024
@jeanduplessis jeanduplessis modified the milestones: 1.3, 1.2 Feb 15, 2024
@jeanduplessis jeanduplessis modified the milestones: 1.3, 2.x Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working codegen v2
Projects
None yet
Development

No branches or pull requests

2 participants