From df976d16cba8998723f33f845c2e5cdd61f10aae Mon Sep 17 00:00:00 2001 From: ZhenYi <434836402@qq.com> Date: Wed, 15 Apr 2026 09:38:46 +0800 Subject: [PATCH] fix(operator): Time to_string and phase type mismatch - Time does not implement Display, use .0 (inner DateTime) and to_rfc3339() instead. - phase is &str, convert to String to match JobStatusResult.phase. --- apps/operator/src/controller/migrate.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/operator/src/controller/migrate.rs b/apps/operator/src/controller/migrate.rs index 47ce299..673351a 100644 --- a/apps/operator/src/controller/migrate.rs +++ b/apps/operator/src/controller/migrate.rs @@ -71,10 +71,10 @@ async fn query_job_status( "Pending" }; - let start_time = status.and_then(|s| s.start_time.as_ref()).map(|t| t.to_string()); - let completion_time = status.and_then(|s| s.completion_time.as_ref()).map(|t| t.to_string()); + let start_time = status.and_then(|s| s.start_time.as_ref()).map(|t| t.0.to_rfc3339()); + let completion_time = status.and_then(|s| s.completion_time.as_ref()).map(|t| t.0.to_rfc3339()); - Ok(JobStatusResult { phase, start_time, completion_time }) + Ok(JobStatusResult { phase: phase.to_string(), start_time, completion_time }) } Err(kube::Error::Api(e)) if e.code == 404 => { Ok(JobStatusResult { phase: "Pending".to_string(), start_time: None, completion_time: None })