diff --git a/docs/book/src/reference/raising-events.md b/docs/book/src/reference/raising-events.md index ccb5d19726f..21a73d12d66 100644 --- a/docs/book/src/reference/raising-events.md +++ b/docs/book/src/reference/raising-events.md @@ -33,10 +33,9 @@ Following is an example of a code implementation that raises an Event. ```go // The following implementation will raise an event - r.Recorder.Event(cr, "Warning", "Deleting", - fmt.Sprintf("Custom Resource %s is being deleted from the namespace %s", - cr.Name, - cr.Namespace)) + r.Recorder.Eventf(cr, "Warning", "Deleting", + "Custom Resource %s is being deleted from the namespace %s", + cr.Name, cr.Namespace) ``` @@ -110,4 +109,4 @@ And then, run `$ make manifests` to update the rules under `config/rbac/role.yam [Event-Example]: https://github.com/kubernetes/api/blob/6c11c9e4685cc62e4ddc8d4aaa824c46150c9148/core/v1/types.go#L6019-L6024 [Reason-Example]: https://github.com/kubernetes/api/blob/6c11c9e4685cc62e4ddc8d4aaa824c46150c9148/core/v1/types.go#L6048 [Message-Example]: https://github.com/kubernetes/api/blob/6c11c9e4685cc62e4ddc8d4aaa824c46150c9148/core/v1/types.go#L6053 -[rbac-markers]: ./markers/rbac.md \ No newline at end of file +[rbac-markers]: ./markers/rbac.md