Skip to content

Commit ec4fee8

Browse files
authored
Merge pull request kubernetes-sigs#4165 from rkosegi/patch-1
📖 Simplify event recording example
2 parents 0dcb3a2 + 264499f commit ec4fee8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

docs/book/src/reference/raising-events.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ Following is an example of a code implementation that raises an Event.
3333

3434
```go
3535
// The following implementation will raise an event
36-
r.Recorder.Event(cr, "Warning", "Deleting",
37-
fmt.Sprintf("Custom Resource %s is being deleted from the namespace %s",
38-
cr.Name,
39-
cr.Namespace))
36+
r.Recorder.Eventf(cr, "Warning", "Deleting",
37+
"Custom Resource %s is being deleted from the namespace %s",
38+
cr.Name, cr.Namespace)
4039
```
4140

4241
</aside>
@@ -110,4 +109,4 @@ And then, run `$ make manifests` to update the rules under `config/rbac/role.yam
110109
[Event-Example]: https://github.com/kubernetes/api/blob/6c11c9e4685cc62e4ddc8d4aaa824c46150c9148/core/v1/types.go#L6019-L6024
111110
[Reason-Example]: https://github.com/kubernetes/api/blob/6c11c9e4685cc62e4ddc8d4aaa824c46150c9148/core/v1/types.go#L6048
112111
[Message-Example]: https://github.com/kubernetes/api/blob/6c11c9e4685cc62e4ddc8d4aaa824c46150c9148/core/v1/types.go#L6053
113-
[rbac-markers]: ./markers/rbac.md
112+
[rbac-markers]: ./markers/rbac.md

0 commit comments

Comments
 (0)