You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/book/src/reference/raising-events.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,10 +41,10 @@ Following is an example of a code implementation that raises an Event.
41
41
42
42
</aside>
43
43
44
-
## How to be able to raise Events?
44
+
###How to be able to raise Events?
45
45
46
46
Following are the steps with examples to help you raise events in your controller's reconciliations.
47
-
Events are published from a Controller using an [EventRecorder]`type CorrelatorOptions struct`,
47
+
Events are published from a Controller using an [EventRecorder][Events]`type CorrelatorOptions struct`,
48
48
which can be created for a Controller by calling `GetRecorder(name string)` on a Manager. See that we will change the implementation scaffolded in `cmd/main.go`:
49
49
50
50
```go
@@ -60,6 +60,7 @@ which can be created for a Controller by calling `GetRecorder(name string)` on a
60
60
```
61
61
62
62
### Allowing usage of EventRecorder on the Controller
63
+
63
64
To raise an event, you must have access to `record.EventRecorder` in the Controller. Therefore, firstly let's update the controller implementation:
64
65
```go
65
66
import (
@@ -89,6 +90,7 @@ which can be created for a Controller by calling `GetRecorder(name string)` on a
89
90
}
90
91
```
91
92
### Granting the required permissions
93
+
92
94
You must also grant the RBAC rules permissions to allow your project to create Events. Therefore, ensure that you add the [RBAC][rbac-markers] into your controller:
0 commit comments