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

Add business id to cronjob chart #156

Merged
Show file tree
Hide file tree
Changes from 8 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 cronjob/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
description: Helm chart with simple cronjob template
name: cronjob
version: 0.9.0
version: 0.10.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remember update version before merge

appVersion: 1.0.0
tillerVersion: ">=2.14.3"
2 changes: 2 additions & 0 deletions cronjob/templates/_argo_cron_workflow.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
podMetadata:
labels:
name: {{ .Values.name }}
businessid: {{ .Values.businessid | quote }}
annotations:
{{- range $key, $value := .Values.annotations }}
{{ $key | quote }} : {{ $value | quote }}
{{- end }}
workflowMetadata:
labels:
name: {{ .Values.name }}
businessid: {{ .Values.businessid | quote }}
annotations:
{{- range $key, $value := .Values.annotations }}
{{ $key | quote }} : {{ $value | quote }}
Expand Down
2 changes: 2 additions & 0 deletions cronjob/templates/_argo_cron_workflow_container_template.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
name: {{ $input.name }}
metadata:
namespace: {{ $namespace }}
labels:
businessid: {{ $input.businessid | quote }}
{{- with $input.podSpecPatch }}
podSpecPatch: {{ quote . }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions cronjob/templates/_k8s_cronjob.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
metadata:
annotations:
cronjob_name: {{ .Values.name }}
labels:
businessid: {{ .Values.businessid | quote }}
spec:
backoffLimit: {{ .Values.job.retries }}
activeDeadlineSeconds: {{ .Values.job.timeout }}
Expand All @@ -13,6 +15,8 @@
{{- range $key, $value := .Values.annotations }}
{{ $key | quote }} : {{ $value | quote }}
{{- end }}
labels:
businessid: {{ .Values.businessid | quote }}
spec:
{{- if .Values.serviceaccount }}
serviceAccountName: {{ .Values.serviceaccount.name | default (printf "%s-pod-service-account" .Values.name) }}
Expand Down
2 changes: 2 additions & 0 deletions cronjob/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ kind: CronJob
metadata:
name: {{ .Values.name }}
namespace: {{ .Release.Namespace }}
labels:
businessid: {{ required "businessid must be provided" .Values.businessid | quote }}
Copy link
Contributor

@ThomasKwan-shopline ThomasKwan-shopline Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add required here, should add required in all businessid field?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the entry point, so I believe checking here would be enough.

spec:
schedule: {{ .Values.schedule | quote }}
# If "kind" eq to "CronWorkflow", timezone can be set. If "kind" eq to "CronWorkflow" and timezone are not set, "Asia/Taipei" will be used
Expand Down
3 changes: 3 additions & 0 deletions cronjob/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ kind: "CronJob"
# example
# kind: CronWorkflow

# Required: please quote the businessid as string
# businessid: "xxxxxxxxxxxxxxxxxx"

# Starting Deadline Seconds of cron job. Will be assign to spec.startingDeadlineSeconds.
startingDeadlineSeconds: {}

Expand Down