From 0920c9988ac951325686973c3caf1057f6d63041 Mon Sep 17 00:00:00 2001 From: Sajiyah Salat <109643863+Sajiyah-Salat@users.noreply.github.com> Date: Tue, 13 Jun 2023 11:20:49 +0000 Subject: [PATCH] Changes done --- docs/book/src/reference/raising-events.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/book/src/reference/raising-events.md b/docs/book/src/reference/raising-events.md index af7d3e53aba..5633d43352a 100644 --- a/docs/book/src/reference/raising-events.md +++ b/docs/book/src/reference/raising-events.md @@ -41,10 +41,10 @@ Following is an example of a code implementation that raises an Event. -## How to be able to raise Events? +### How to be able to raise Events? Following are the steps with examples to help you raise events in your controller's reconciliations. -Events are published from a Controller using an [EventRecorder]`type CorrelatorOptions struct`, +Events are published from a Controller using an [EventRecorder][Events]`type CorrelatorOptions struct`, 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`: ```go @@ -60,6 +60,7 @@ which can be created for a Controller by calling `GetRecorder(name string)` on a ``` ### Allowing usage of EventRecorder on the Controller + To raise an event, you must have access to `record.EventRecorder` in the Controller. Therefore, firstly let's update the controller implementation: ```go import ( @@ -89,6 +90,7 @@ which can be created for a Controller by calling `GetRecorder(name string)` on a } ``` ### Granting the required permissions + 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: ```go ...