View Source mix bonny.gen.controller (bonny v0.5.0)
Generates a new CRD controller
An operator can have multiple controllers. Each controller handles the lifecycle of a custom resource.
By default controllers are generated in the V1
version scope.
mix bonny.gen.controller Widget widget
You can specify the version flag to create a new version of a controller. Bonny will dispatch the controller for the given version. So old versions of resources can live alongside new versions.
mix bonny.gen.controller Widget widget --version v2alpha1
Note: The one restriction with versions is that they will be camelized into a module name.
Open up your controller and add functionality for your resources lifecycle:
- Add
- Modify
- Delete
Each controller can create multiple resources.
For example, a todo app controller could deploy a Deployment
and a Service
.
Link to this section Summary
Functions
Callback implementation for Mix.Task.run/1
.
Link to this section Functions
@spec run([binary()]) :: nil | :ok
Callback implementation for Mix.Task.run/1
.