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: String
The 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§
impl Eq for Reporter
impl StructuralPartialEq for Reporter
Auto Trait Implementations§
impl Freeze for Reporter
impl RefUnwindSafe for Reporter
impl Send for Reporter
impl Sync for Reporter
impl Unpin for Reporter
impl UnwindSafe for Reporter
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.