Warnings
Answer questions about Kubernetes Events, as the API returns them (core/v1 or events.k8s.io/v1), passed as a list or an EventList. Only Warning events count, so a caller can pass all of an object’s events.
Reference
| Function | Description |
|---|---|
firstWarning | Returns the message of the first Warning event; "" when there is none. |
hasWarnings | Reports whether any of the events is a Warning. |
warningCount | Returns the number of Warning events. |
warningMessages | Returns the message of each Warning event, in order. |
warningReasons | Returns the reason of each Warning event, in order. |
Functions
firstWarning
firstWarning returns the message of the first Warning event; "" when there is none.
{{ firstWarning .events }} → "Failed to pull image registry.example.com/web:2.0: not found"
hasWarnings
hasWarnings reports whether any of the events is a Warning.
{{ hasWarnings .events }}
warningCount
warningCount returns the number of Warning events.
{{ warningCount .events }} → 2
warningMessages
warningMessages returns the message of each Warning event, in order.
{{ warningMessages .events }}
→ [Back-off restarting failed container Liveness probe failed]
warningReasons
warningReasons returns the reason of each Warning event, in order.
{{ warningReasons .events }} → [Failed BackOff]