fix: validate successfulJobsHistoryLimit in cronjob-task

Signed-off-by: Abhinav Sinha <[email protected]>
This commit is contained in:
Abhinav Sinha
2026-06-14 04:32:26 +05:30
parent f1a35fec4f
commit a3053c8b0c
+11 -5
View File
@@ -1363,8 +1363,8 @@
"hints": [ "hints": [
{ {
"title": "CronJob manifest", "title": "CronJob manifest",
"body": "Use `kubectl create cronjob` or apply a manifest. The schedule uses standard cron syntax.", "body": "Use `kubectl create cronjob` and then patch with `successfulJobsHistoryLimit: 3`, or create a cronjob with a manifest. The schedule uses standard cron syntax.",
"command": "kubectl create cronjob date-printer --image=busybox:1.36 --schedule='* * * * *' -- date" "command": "cat <<EOF | kubectl apply -f -\napiVersion: batch/v1\nkind: CronJob\nmetadata:\n name: date-printer\nspec:\n schedule: \"* * * * *\"\n successfulJobsHistoryLimit: 3\n jobTemplate:\n spec:\n template:\n spec:\n restartPolicy: OnFailure\n containers:\n - name: printer\n image: busybox:1.36\n command: [\"date\"]\nEOF"
} }
], ],
"setup_commands": [], "setup_commands": [],
@@ -1383,10 +1383,16 @@
"match": "exact" "match": "exact"
}, },
{ {
"description": "CronJob uses busybox image", "description": "CronJob uses busybox:1.36 image",
"command": "kubectl get cronjob date-printer -o jsonpath='{.spec.jobTemplate.spec.template.spec.containers[0].image}'", "command": "kubectl get cronjob date-printer -o jsonpath='{.spec.jobTemplate.spec.template.spec.containers[0].image}'",
"expected_output": "busybox", "expected_output": "busybox:1.36",
"match": "contains" "match": "exact"
},
{
"description": "CronJob has successfulJobsHistoryLimit: 3",
"command": "kubectl get cronjob date-printer -o jsonpath='{.spec.successfulJobsHistoryLimit}'",
"expected_output": "3",
"match": "exact"
} }
] ]
}, },