This is an example PR to show rougly the changes necessary to add the skeleton for a new API and Controller.
NOTE
This example adds a namespaced resource. If you want to use a global resource (like most of our operator APIs), specify --namespaced=false on step 1.
The commits are broken down and show precisely which commands were run.
Specifically:
Generate the new Resource and controller skeleton
operator-sdk create api --group=operator.tigera.io --version=v1 --kind=DemoResource --resource --controller
Generate manifests
make manifests
Add a new Reconciler to pkg/controller, and point the internal/controller implementation at it.
The next steps here would be to fill out the Add and Reconcile functions in pkg/controller/demoresource/demoresource_controller.go with the specific logic of the new feature.
For PR author
[ ] Tests for change.
[ ] If changing pkg/apis/, run make gen-files
[ ] If changing versions, run make gen-versions
For PR reviewers
A note for code reviewers - all pull requests must have the following:
[ ] Milestone set according to targeted release.
[ ] Appropriate labels:
kind/bug if this is a bugfix.
kind/enhancement if this is a a new feature.
enterprise if this PR applies to Calico Enterprise only.
Love it.. what version of operator-sdk should I use for this? If we have a specific version that works with our PROJECT file maybe we could consider a dockerized version as a makefile target perhaps?
Description
This is an example PR to show rougly the changes necessary to add the skeleton for a new API and Controller.
NOTE
--namespaced=false
on step 1.The commits are broken down and show precisely which commands were run. Specifically:
Generate the new Resource and controller skeleton
Generate manifests
Add a new Reconciler to
pkg/controller
, and point theinternal/controller
implementation at it.The next steps here would be to fill out the
Add
andReconcile
functions inpkg/controller/demoresource/demoresource_controller.go
with the specific logic of the new feature.For PR author
make gen-files
make gen-versions
For PR reviewers
A note for code reviewers - all pull requests must have the following:
kind/bug
if this is a bugfix.kind/enhancement
if this is a a new feature.enterprise
if this PR applies to Calico Enterprise only.