Skip to content

Commit

Permalink
Update docs/book/src/reference/creating-events.md
Browse files Browse the repository at this point in the history
Co-authored-by: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com>
  • Loading branch information
Sajiyah-Salat and camilamacedo86 committed May 8, 2023
1 parent e29dedb commit 09d32a0
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions docs/book/src/reference/creating-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,6 @@ which can be created for a Controller by calling `GetRecorder(name string)` on a

c) You can check an example of the event being called in: https://github.com/kubernetes-sigs/kubebuilder/blob/master/testdata/project-v4-with-deploy-image/controllers/memcached_controller.go#L299-L303

Events are published from a Controller using an [EventRecorder]`type CorrelatorOptions struct`,
which can be created for a Controller by calling `GetRecorder(name string)` on a Manager.

`Name` should be identifiable and descriptive as it will appear in the `From` column of `kubectl describe` command.


```go
// Annotation for generating RBAC role for writing Events
// +kubebuilder:rbac:groups="",resources=events,verbs=create;patch
```

```go
// ReconcileContainerSet reconciles a ContainerSet object
type ReconcileContainerSet struct {
client.Client
scheme *runtime.Scheme
recorder record.EventRecorder
}
```
```go
// newReconciler returns a new reconcile.Reconciler
func newReconciler(mgr manager.Manager) reconcile.Reconciler {
Expand Down

0 comments on commit 09d32a0

Please sign in to comment.