From ea76b554606a876c21580473b3a18b526d8b8487 Mon Sep 17 00:00:00 2001 From: SergeyLadutko <40435115+SergeyLadutko@users.noreply.github.com> Date: Fri, 29 Sep 2023 18:44:24 +0300 Subject: [PATCH] fix(action): populate all fields of Job from CronJob (#15259) (#15727) Signed-off-by: sergey.ladutko Co-authored-by: sergey.ladutko --- .../batch/CronJob/actions/create-job/action.lua | 6 +----- .../batch/CronJob/actions/testdata/cronjob.yaml | 1 + .../batch/CronJob/actions/testdata/job.yaml | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/resource_customizations/batch/CronJob/actions/create-job/action.lua b/resource_customizations/batch/CronJob/actions/create-job/action.lua index 4b1583086991a7..8753144d404e7f 100644 --- a/resource_customizations/batch/CronJob/actions/create-job/action.lua +++ b/resource_customizations/batch/CronJob/actions/create-job/action.lua @@ -47,11 +47,7 @@ ownerRef.uid = obj.metadata.uid job.metadata.ownerReferences = {} job.metadata.ownerReferences[1] = ownerRef -job.spec = {} -job.spec.suspend = false -job.spec.template = {} -job.spec.template.metadata = deepCopy(obj.spec.jobTemplate.spec.template.metadata) -job.spec.template.spec = deepCopy(obj.spec.jobTemplate.spec.template.spec) +job.spec = deepCopy(obj.spec.jobTemplate.spec) local impactedResource = {} impactedResource.operation = "create" diff --git a/resource_customizations/batch/CronJob/actions/testdata/cronjob.yaml b/resource_customizations/batch/CronJob/actions/testdata/cronjob.yaml index d422c82da393ae..2c45c5eae1f386 100644 --- a/resource_customizations/batch/CronJob/actions/testdata/cronjob.yaml +++ b/resource_customizations/batch/CronJob/actions/testdata/cronjob.yaml @@ -13,6 +13,7 @@ spec: annotations: my: annotation spec: + ttlSecondsAfterFinished: 100 template: metadata: labels: diff --git a/resource_customizations/batch/CronJob/actions/testdata/job.yaml b/resource_customizations/batch/CronJob/actions/testdata/job.yaml index 16d4e4960b0dc1..1ef281afdcdb4e 100644 --- a/resource_customizations/batch/CronJob/actions/testdata/job.yaml +++ b/resource_customizations/batch/CronJob/actions/testdata/job.yaml @@ -10,6 +10,7 @@ annotations: my: annotation spec: + ttlSecondsAfterFinished: 100 template: metadata: labels: