Skip to content

Commit

Permalink
Merge branch 'master' into update-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
dennispan authored Dec 14, 2023
2 parents 35aec10 + a6d8a01 commit b490f28
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,18 @@ if job.metadata == nil then
end
job.metadata.name = obj.metadata.name .. "-" ..os.date("!%Y%m%d%H%M")
job.metadata.namespace = obj.metadata.namespace
if job.metadata.annotations == nil then
job.metadata.annotations = {}
end
job.metadata.annotations['cronjob.kubernetes.io/instantiate'] = "manual"

local ownerRef = {}
ownerRef.apiVersion = obj.apiVersion
ownerRef.kind = obj.kind
ownerRef.name = obj.metadata.name
ownerRef.uid = obj.metadata.uid
ownerRef.blockOwnerDeletion = true
ownerRef.controller = true
job.metadata.ownerReferences = {}
job.metadata.ownerReferences[1] = ownerRef

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
labels:
my: label
annotations:
cronjob.kubernetes.io/instantiate: manual
my: annotation
spec:
ttlSecondsAfterFinished: 100
Expand All @@ -26,4 +27,4 @@
- /bin/sh
- -c
- date; echo Hello from the Kubernetes cluster
restartPolicy: OnFailure
restartPolicy: OnFailure

0 comments on commit b490f28

Please sign in to comment.