Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ job = {}
job.apiVersion = "batch/v1"
job.kind = "Job"

job.metadata = {}
job.metadata = deepCopy(obj.spec.jobTemplate.metadata)
if job.metadata == nil then
job.metadata = {}
end
job.metadata.name = obj.metadata.name .. "-" ..os.date("!%Y%m%d%H%M")
job.metadata.namespace = obj.metadata.namespace

Expand All @@ -47,6 +50,7 @@ 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)

impactedResource = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@ metadata:
spec:
schedule: "* * * * *"
jobTemplate:
metadata:
labels:
my: label
annotations:
my: annotation
spec:
template:
metadata:
labels:
pod: label
annotations:
pod: annotation
spec:
containers:
- name: hello
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@
metadata:
name: hello-00000000000
namespace: test-ns
labels:
my: label
annotations:
my: annotation
spec:
template:
metadata:
labels:
pod: label
annotations:
pod: annotation
spec:
containers:
- name: hello
Expand Down