Skip to content

MoAM-CNEE/provider-message-service

 
 

Repository files navigation

provider-dummymessageservice

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

  • A ProviderConfig type that only points to a credentials Secret.
  • A MyType resource type that serves as an example managed resource.
  • A managed resource controller that reconciles MyType objects and simply prints their configuration in its Observe method.

Developing

  1. Use this repository as a dummymessageservice 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. Run make reviewable to run code generation, linters, and tests. Ignore linters and tests hehe
  5. Run make build to build the provider. Notice the xpkg saved to ... line
  6. Run make push-xpkg UPBOUND_USER=dummy XPKG_VER=v0.0.1 XPKG_PATH=/path/to/xpkg

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

Running

make run-example

Re-using package version

Crossplane creates a ReplicaSet for the provider with imagePullPolicy: IfNotPresent so overwriting an already pulled version of image won't update it.

Workaround:

  1. Uninstall the provider kubectl delete -f examples/provider/provider.yaml
  2. Override finalizers of CRs managed by it make override-finalizers
  3. Find the node on which the pod is running: kubectl get pod <pod-name> -n <namespace> -o wide
  4. ssh <node_ip>
  5. Delete the image, cri-o example: sudo crictl images; sudo crictl rmi <image_id>

Sources

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 69.8%
  • Shell 15.3%
  • Makefile 13.3%
  • Dockerfile 1.6%