Skip to content

Commit

Permalink
feat: Print timestamp_nanos in hexadecimal
Browse files Browse the repository at this point in the history
Following the same pattern than the go-client.

Signed-off-by: Alexander Gil <pando855@gmail.com>
  • Loading branch information
pando85 committed Dec 5, 2024
1 parent bebbb10 commit e8e4b54
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kube-runtime/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ pub enum EventType {
Warning,
}

/// ObjectReference with Hash and Eq implementations
/// [`ObjectReference`] with Hash and Eq implementations
///
/// [`ObjectReference`]: k8s_openapi::api::core::v1::ObjectReference
#[derive(Clone, Debug, PartialEq)]
pub struct Reference(ObjectReference);

Expand Down Expand Up @@ -265,7 +267,7 @@ impl Recorder {
metadata: ObjectMeta {
namespace: reference.namespace.clone(),
name: Some(format!(
"{}.{}",
"{}.{:x}",
reference.name.as_ref().unwrap_or(&self.reporter.controller),
now.timestamp_nanos_opt().unwrap_or_else(|| now.timestamp())
)),
Expand Down

0 comments on commit e8e4b54

Please sign in to comment.