Skip to content

Commit

Permalink
Allow setting ttlSecondsAfterFinished for dbMigrator job
Browse files Browse the repository at this point in the history
Signed-off-by: Armin Gerten <armin@gerten.de>
  • Loading branch information
armingerten authored Feb 6, 2023
1 parent 4439e94 commit cc75c86
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 43 deletions.
2 changes: 1 addition & 1 deletion charts/artifact-hub/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: artifact-hub
description: Artifact Hub is a web-based application that enables finding, installing, and publishing Kubernetes packages.
type: application
version: 1.12.1-1
version: 1.12.1-2
appVersion: 1.12.0
kubeVersion: ">= 1.19.0-0"
home: https://artifacthub.io
Expand Down
36 changes: 0 additions & 36 deletions charts/artifact-hub/templates/db_migrator_install_job.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
apiVersion: batch/v1
kind: Job
metadata:
{{- if .Release.IsInstall }}
name: {{ include "chart.resourceNamePrefix" . }}db-migrator-install
{{- else }}
name: {{ include "chart.resourceNamePrefix" . }}db-migrator-upgrade
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-weight": "0"
"helm.sh/hook-delete-policy": before-hook-creation
{{- end }}
spec:
ttlSecondsAfterFinished: {{ .Values.dbMigrator.job.ttlSecondsAfterFinished }}
template:
spec:
{{- with .Values.imagePullSecrets }}
Expand Down
18 changes: 12 additions & 6 deletions charts/artifact-hub/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,20 @@
"required": [
"repository"
]
},
"resources": {
"title": "DB migrator pod resource requirements",
"type": "object",
"default": {},
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.19.0/_definitions.json#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
"ttlSecondsAfterFinished": {
"title": "Lifetime after finished execution",
"description": "Limits the lifetime of the job after it has finished execution",
"default": null,
"type": ["null", "integer"]
}
},
"resources": {
"title": "DB migrator pod resource requirements",
"type": "object",
"default": {},
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.19.0/_definitions.json#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
"required": [
"image"
]
Expand Down
2 changes: 2 additions & 0 deletions charts/artifact-hub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ dbMigrator:
image:
# Database migrator image repository (without the tag)
repository: artifacthub/db-migrator
# Limits the lifetime of the job after it has finished execution
ttlSecondsAfterFinished: null
resources: {}
# If you do want to specify resources, uncomment the following
# lines and adjust them as necessary.
Expand Down

0 comments on commit cc75c86

Please sign in to comment.