From 389f304042275fa30f6a1f900e0d7ffa5be5e21f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20Bro=C5=84ski?= Date: Thu, 27 Feb 2025 11:14:22 +0100 Subject: [PATCH] Include labels when creating task. --- src/commands/tasks.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/commands/tasks.rs b/src/commands/tasks.rs index d36e6af..8bebb90 100644 --- a/src/commands/tasks.rs +++ b/src/commands/tasks.rs @@ -193,6 +193,13 @@ pub async fn create_task( .map(|e| (e.source.clone(), e.target.clone())) .collect(); + let labels: HashMap = task + .metadata + .labels + .into_iter() + .map(|label| (label.key, label.value)) + .collect(); + let resp = client .tasks .create( @@ -219,6 +226,7 @@ pub async fn create_task( .time(task.spec.resources.time as u64) .store_stdout(task.spec.store_stdout.unwrap_or(false)) .store_stderr(task.spec.store_stderr.unwrap_or(false)) + .labels(labels) .into_message()?, ) .await?;