Struct kube_runtime::events::Reporter
source · pub struct Reporter {
pub controller: String,
pub instance: Option<String>,
}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.name
in the manifest of your controller.
NB: If no instance is provided, then reporting_instance == reporting_controller in the Event.
Trait Implementations§
source§impl PartialEq<Reporter> for Reporter
impl PartialEq<Reporter> for Reporter
impl Eq for Reporter
impl StructuralEq for Reporter
impl StructuralPartialEq for Reporter
Auto Trait Implementations§
impl RefUnwindSafe for Reporter
impl Send for Reporter
impl Sync for Reporter
impl Unpin for Reporter
impl UnwindSafe for Reporter
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.