From a7398419cd6d0b2e25aa8ed0bfdf6cc1016c7565 Mon Sep 17 00:00:00 2001 From: belo4ya <41exey.kov41ev@gmail.com> Date: Tue, 25 Jun 2024 12:08:17 +0300 Subject: [PATCH] job-controller: added pod annotation with current Job RetryCount value Feat #3528 Signed-off-by: belo4ya <41exey.kov41ev@gmail.com> --- go.mod | 2 +- go.sum | 4 ++-- pkg/controllers/job/job_controller_util.go | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f502146982..4b2d3021fb 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,7 @@ require ( sigs.k8s.io/controller-runtime v0.13.0 sigs.k8s.io/yaml v1.3.0 stathat.com/c/consistent v1.0.0 - volcano.sh/apis v1.10.0-alpha.0 + volcano.sh/apis v1.10.0-alpha.0.0.20240709084748-78d912ce096c ) require ( diff --git a/go.sum b/go.sum index 4837ede7f3..e1d34ca47b 100644 --- a/go.sum +++ b/go.sum @@ -406,5 +406,5 @@ sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= stathat.com/c/consistent v1.0.0 h1:ezyc51EGcRPJUxfHGSgJjWzJdj3NiMU9pNfLNGiXV0c= stathat.com/c/consistent v1.0.0/go.mod h1:QkzMWzcbB+yQBL2AttO6sgsQS/JSTapcDISJalmCDS0= -volcano.sh/apis v1.10.0-alpha.0 h1:U6gec9Z+06E9f/FFdF+nYNIgpibRUuvTyViJcJOqHnY= -volcano.sh/apis v1.10.0-alpha.0/go.mod h1:z8hhFZ2qcUMR1JIjVYmBqL98CVaXNzsQAcqKiytQW9s= +volcano.sh/apis v1.10.0-alpha.0.0.20240709084748-78d912ce096c h1:22v0MX/Cd9PQX5GU/vF1DUiVzPEvPmEv2CjZuAt3fmU= +volcano.sh/apis v1.10.0-alpha.0.0.20240709084748-78d912ce096c/go.mod h1:z8hhFZ2qcUMR1JIjVYmBqL98CVaXNzsQAcqKiytQW9s= diff --git a/pkg/controllers/job/job_controller_util.go b/pkg/controllers/job/job_controller_util.go index 4a29c799e5..2fc2090fb3 100644 --- a/pkg/controllers/job/job_controller_util.go +++ b/pkg/controllers/job/job_controller_util.go @@ -109,6 +109,7 @@ func createJobPod(job *batch.Job, template *v1.PodTemplateSpec, topologyPolicy b pod.Annotations[batch.QueueNameKey] = job.Spec.Queue pod.Annotations[batch.JobVersion] = fmt.Sprintf("%d", job.Status.Version) pod.Annotations[batch.PodTemplateKey] = fmt.Sprintf("%s-%s", job.Name, template.Name) + pod.Annotations[batch.JobRetryCountKey] = strconv.Itoa(int(job.Status.RetryCount)) if topologyPolicy != "" { pod.Annotations[schedulingv2.NumaPolicyKey] = string(topologyPolicy)