crossplane / provider-template

A template for building @crossplane providers.
https://crossplane.io
Apache License 2.0
135 stars 74 forks source link

Add helper make targets to prepare repo and add new types #50

Closed turkenh closed 2 years ago

turkenh commented 2 years ago

Description of your changes

This PR adds the following two make targets:

# This target prepares repo for your provider by replacing all "template"
# occurrences with your provider name.
# This target can only be run once, if you want to rerun for some reason,
# consider stashing/resetting your git state.
# Arguments:
#   provider: Camel case name of your provider, e.g. GitHub, PlanetScale
provider.prepare:
# This target adds a new api type and its controller.
# You would still need to register new api in "apis/<provider>.go" and
# controller in "internal/controller/<provider>.go".
# Arguments:
#   provider: Camel case name of your provider, e.g. GitHub, PlanetScale
#   group: API group for the type you want to add.
#   kind: Kind of the type you want to add
#   apiversion: API version of the type you want to add. Optional and defaults to "v1alpha1"
provider.addtype:

I have:

How has this code been tested

make provider.prepare provider=GitHub

make provider.addtype provider=GitHub group=Organization kind=Project

# Register the new API in "apis/github.go"
# Register the new Controller in "internal/controller/github.go"

make generate
turkenh commented 2 years ago

Issue in Crossplane Tools: https://github.com/crossplane/crossplane-tools/issues/41