Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cronjob spec suspend #7 #8

Merged
merged 3 commits into from
Aug 12, 2022
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
2 changes: 1 addition & 1 deletion drpsychick/cronjobs/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: cronjobs
description: A generic helm cronjob chart for kubernetes
type: application
version: 0.1.0
version: 0.1.1
appVersion: latest
home: https://github.com/DrPsychick
icon: https://raw.githubusercontent.com/DrPsychick/charts/master/drpsychick/cronjobs/icon.png
Expand Down
5 changes: 5 additions & 0 deletions drpsychick/cronjobs/ci/scripts-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ jobs:
cat:
schedule: "* * * * *"
command: ["cat", "/configMaps/config/config.ini"]

suspended:
schedule: "* * * * *"
command: ["cat", "/var/log/messages"]
suspend: true
4 changes: 2 additions & 2 deletions drpsychick/cronjobs/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ spec:
failedJobsHistoryLimit: {{ default 1 .failedJobsHistoryLimit }}
successfulJobsHistoryLimit: {{ default 1 .successfulJobsHistoryLimit }}
schedule: {{ .schedule | quote }}
{{- if .suspended }}
suspended: {{ .suspended }}
{{- if .suspend }}
suspend: {{ .suspend }}
{{- end }}
{{- if .startingDeadlineSeconds }}
startingDeadlineSeconds: {{ .startingDeadlineSeconds }}
Expand Down
10 changes: 8 additions & 2 deletions drpsychick/cronjobs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,14 @@ jobs: {}
# image:
# repository: alpine
# # see https://github.com/kubernetes/kubernetes/issues/74848#issuecomment-475178355
# #restartPolicy: Never
# concurrencyPolicy|parallelism|backoffLimit|ttlSecondsAfterFinished|...
# # restartPolicy: Never
# # startingDeadlineSeconds: 60
# # activeDeadlineSeconds: 60
# # backoffLimit: 3
# # completions: 3
# # parallelism: 1
# # ttlSecondsAfterFinished: 60
# # suspend: false

serviceAccount:
# Specifies whether a service account should be created
Expand Down