upjet: panic generating crd: invalid schema type TypeInvalid

What happened?

I am trying to generate a new Upjet provider from the Elastic Cloud Terraform Provider.

The first resource I would like to generate is ec_deployment but I am encountering an error during make generate:

panic: cannot generate crd for resource ec_deployment: 
cannot build types for ElasticCloudDeployment: 
cannot build the Types for resource "ec_deployment": 
cannot infer type from schema of field apm: invalid schema type TypeInvalid

The only related issue I could find was #121, but it looks like that issue was fixed by #130 and released in the latest version of upjet (that I’m using): v1.1.0.

How can we reproduce it?

Try running make generate in the repository: https://github.com/jaylevin/provider-elastic-cloud

Schema.json: https://github.com/jaylevin/provider-elastic-cloud/blob/main/config/schema.json

Any help would be greatly appreciated, thanks in advance 😃

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 17
  • Comments: 21 (5 by maintainers)

Commits related to this issue

Most upvoted comments

We will discuss this topic at the next Upjet SIG meeting on Aug 14: https://docs.google.com/document/d/1QJfsAk-pdo_j2cKsJtG6W-BOQh_3ilhiRVTYVIGkDXM/edit

+1 to the list of blocked people 😃

Maybe you can suggest some workaround, like manually generating missing types? Or annotating somehow these nested blocks so code pipeline can reason from them?

Or… just assume it’s an object type with “preserve unknown fields” annotation in CRD, this way we can at least generate most of the work and then do workarounds manually.