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

Allow user to delete job pod on completion #222

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 cockroachdb/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: cockroachdb
home: https://www.cockroachlabs.com
version: 7.0.0
version: 7.0.1
appVersion: 21.2.5
description: CockroachDB is a scalable, survivable, strongly-consistent SQL database.
icon: https://raw.githubusercontent.com/cockroachdb/cockroach/master/docs/media/cockroach_db.png
Expand Down
4 changes: 4 additions & 0 deletions cockroachdb/templates/job.init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ metadata:
{{- end }}
annotations:
helm.sh/hook: post-install,post-upgrade
{{- if .Values.init.deleteJobOnCompletion }}
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
{{- else }}
helm.sh/hook-delete-policy: before-hook-creation
{{- end }}
Comment on lines +23 to +27
Copy link
Contributor

Choose a reason for hiding this comment

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

We can keep this deletion behaviour as default one and add an option in values.yaml to disable this

spec:
template:
metadata:
Expand Down
3 changes: 3 additions & 0 deletions cockroachdb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ init:
# Additional annotations to apply to the Pod of this Job.
annotations: {}

# If true init job is deleted when completed. If false the job stays in complete status.
deleteJobOnCompletion: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be better if we rename it to something helm hook related like enable-delete-hook


# Affinity rules for scheduling the Pod of this Job.
# https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity
affinity: {}
Expand Down