-
Notifications
You must be signed in to change notification settings - Fork 89
Description
What are current challenges for using provider-template
I spent some time to dogfooding the provider-template with the current setup, and there are a few points I would like to bring up and improve them.
-
A few manual steps are required to make it works. For example, in order to initialize the generated repository, you will not only need to run Makefile to change some predefined names in one or more places. For example,
go.mod,Makefileitself and theapisfolder for changing repository name. -
Instead of maintaining ready-to-work example provider, it would be reasonable to make it templated through go-templating or similar approach already introduced under
hack/helpers. I believe the concept of ready-to-work provider is to show case the provider-template trying to demonstrate but importantly it's to make it friendly and extendable for anyone who interested in developing their own provider for Crossplane. Ideally, we can extent what exists inhack/heplers, and let it be able to bootstrap the whole go code likego.mod,Makefile,apis,internal,cmdand so on kind of likeupjetis doing. By doing this, we're able to make sure whoever using the template can always bootstrap a clean and ready-to-go provider with bare minimal setup. -
Currently,
provider-templateis targeting Crossplane v1, but in the foreseeable future, we might need to support v2 for namespaced resources.
Proposed improvements
- Extend
hack/helpersto be able to support not only for an API GVK, but also for other things likecmd,go.modand maybeMakefile. So we can skip some manual steps, and let the tool do the job - Explorer an implementation for Crossplane v2, the
provider-templateafter this should be able to generate a provider for either v1 or v2.