crossplane / terrajet

Generate Crossplane Providers from any Terraform Provider
https://crossplane.io
Apache License 2.0
290 stars 38 forks source link

Generator cannot run when there is no Go file in apis folder #80

Closed muvaf closed 2 years ago

muvaf commented 3 years ago

What happened?

When I delete all generated files from apis folder, the following side-effect import throws error:

_ "github.com/crossplane-contrib/provider-tf-aws/apis"
imports github.com/crossplane-contrib/provider-tf-aws/apis: build constraints exclude all Go files in /Users/monus/go/src/github.com/crossplane/provider-tf-aws/apis

I think we should have a non-generated Go file in apis folder that contains a config.Provider object that will be populated by the init() calls of custom.go files in CRD packages instead of targeting the Provider instance in Terrajet package.

How can we reproduce it?

turkenh commented 2 years ago

We had a couple of offline discussions about some restructuring around how we are taking custom configuration from users. @ulucinar also mentioned today, the experience would be much better if we put custom configuration into a separate directory like custom/rds/custom.go instead of apis/rds/custom.go which would then allow us to clean up simply by deleting apis and internal directories before generating schema and controllers.

I wanted to mention this here since it could be fixed by importing a non-generating directory as a side effect.

turkenh commented 2 years ago

Similarly, this will be resolved as part of #61