GitHub - crossplane/provider-template: A template for building @crossplane providers. (original) (raw)

provider-template is a minimal Crossplane Provider that is meant to be used as a template for implementing new Providers. It comes with the following features that are meant to be refactored:

Developing

  1. Use this repository as a template to create a new one.
  2. Run make submodules to initialize the "build" Make submodule we use for CI/CD.
  3. Rename the provider by running the following command:

export provider_name=MyProvider # Camel case, e.g. GitHub make provider.prepare provider=${provider_name}

  1. Add your new type by running the following command:

export group=sample # lower case e.g. core, cache, database, storage, etc. export type=MyType # Camel casee.g. Bucket, Database, CacheCluster, etc. make provider.addtype provider=${provider_name} group=${group} kind=${type}

  1. Replace the sample group with your new group in apis/{provider}.go
  2. Replace the mytype type with your new type in internal/controller/{provider}.go
  3. Replace the default controller and ProviderConfig implementations with your own
  4. Register your new type into SetupGated function in internal/controller/register.go
  5. Run make reviewable to run code generation, linters, and tests.
  6. Run make build to build the provider.

Refer to Crossplane's CONTRIBUTING.md file for more information on how the Crossplane community prefers to work. The Provider Developmentguide may also be of use.