Struct kube_runtime::events::Reporter
source · [−]Expand description
Information about the reporting controller.
use kube::runtime::events::Reporter;
let reporter = Reporter {
controller: "my-awesome-controller".into(),
instance: std::env::var("CONTROLLER_POD_NAME").ok(),
};Fields
controller: StringThe name of the reporting controller that is publishing the event.
This is likely your deployment.metadata.name.
instance: Option<String>The id of the controller publishing the event. Likely your pod name.
Useful when running more than one replica on your controller and you need to disambiguate where events came from.
The name of the controller pod can be retrieved using Kubernetes’ API or it can be injected as an environment variable using
env:
- name: CONTROLLER_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.namein the manifest of your controller.
NB: If no instance is provided, then reporting_instance == reporting_controller in the Event.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Reporter
impl UnwindSafe for Reporter
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.
pub fn vzip(self) -> V
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more