Run the following command to generate a controller template
cd dev/tools/controllerbuilder
go run main.go generate-controller --service <YOUR_SERVICE> --api-version <VERSION> --kind <YOUR_RESOURCE> --proto-resource <PROTO_RESOURCE>
Fix the generated code to make your SciFi running!
The controller template has implemented the model interfacefind, create, update, delete
and export
. You may need to update the code to fit your resource.
Most Config Connector resource need references like spec.projectRef.
You should add those references in AdapterForObject
using functions Resolve<RefResource>
if there is no previous reference method, You may need to add a newResolve<RefResource>
Check to make sure your validation is complete.
To turn on the SciFi controller to reconcile resources:
hack/compare-mock fixtures/<your_resource_test>
KCC_USE_DIRECT_RECONCILERS=<YOUR KIND> hack/compare-mock fixtures/<your_resource_test>
- Note: Differences in http.logs such as
user-agent
and method url are expected. Please regenerate test logs beforecompare-mock
.
- The PRs shall pass the MockGCP tests
- For Beta resource, the roundtrip fuzz tests shall cover all the fields in
spec
andstatus.observedState
fields. Example