From 79074f229a76206167ec80ecbb655d3a9c0e12f4 Mon Sep 17 00:00:00 2001 From: Alexander Gil Date: Thu, 5 Dec 2024 17:31:16 +0100 Subject: [PATCH] feat: Print `timestamp_nanos` in hexadecimal Following the same pattern than the go-client. --- kube-runtime/src/events.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kube-runtime/src/events.rs b/kube-runtime/src/events.rs index 9c5faefb5..e07f2ce34 100644 --- a/kube-runtime/src/events.rs +++ b/kube-runtime/src/events.rs @@ -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); @@ -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()) )),