Skip to content

Commit 446644c

Browse files
Feat: Job history limit (#26)
* delete finished jobs after 30 minutes * change jobsHistoryLimit to save only last success and failed job * restore chart version * update chart version * add ttlSecondsAfterFinished value --------- Co-authored-by: yishaynaPalo <ynadav@paloaltonetworks.com>
1 parent 9d7e246 commit 446644c

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

.github/workflows/lint-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Set up Python
2222
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
2323
with:
24-
python-version: 3.x
24+
python-version: 3.12
2525

2626
- name: Set up chart-testing
2727
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0

charts/konnector/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: konnector
33
description: Deploys Palo Alto Networks' Cortex KSPM connector for advanced Kubernetes security posture management.
44
type: application
5-
version: 1.0.24-rc.0
5+
version: 1.0.24-rc.1
66
appVersion: "1.0.0"
77
maintainers:
88
- name: Palo Alto Networks - Cortex KSPM team

charts/konnector/templates/_helpers.tpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,15 @@ app.kubernetes.io/author: {{ .Values.namespace.name }}
3838
{{- printf "%d */1 * * *" $minute -}}
3939
{{- end -}}
4040

41+
{{- define "common.jobsHistoryLimit" -}}
42+
successfulJobsHistoryLimit: 1
43+
failedJobsHistoryLimit: 1
44+
{{- end -}}
45+
4146
{{- define "common.jobTemplate" -}}
4247
spec:
4348
backoffLimit: {{ .Values.system.batch.backoffLimit }}
49+
ttlSecondsAfterFinished: {{ .Values.system.batch.ttlSecondsAfterFinished }}
4450
template:
4551
metadata:
4652
labels:

charts/konnector/templates/batch.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ metadata:
1919
{{- include "common.labels" . | nindent 4 }}
2020
spec:
2121
schedule: {{ include "common.generateSchedule" . | quote }}
22+
{{- include "common.jobsHistoryLimit" . | nindent 2 }}
2223
jobTemplate:
2324
{{- include "common.jobTemplate" . | nindent 4 }}
2425
---

charts/konnector/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ system:
5050
# ==========================
5151
batch:
5252
backoffLimit: 4 # Maximum number of retries before the job is considered failed. After 4 attempts, the job will fail.
53+
ttlSecondsAfterFinished: 3600 # Time-to-live for completed jobs, jobs will be automatically deleted 3600 seconds (1 hour) after completion
5354

5455
# ==========================
5556
# Service Account Resources

0 commit comments

Comments
 (0)