-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from jadolg/add-non-injectable-test
Improve tests adding a scenario with a CronJob that doesn't need to be changed
- Loading branch information
Showing
2 changed files
with
183 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
{ | ||
"kind": "AdmissionReview", | ||
"apiVersion": "admission.k8s.io/v1", | ||
"request": { | ||
"uid": "34dc2238-8365-4dab-8807-7685596da8a5", | ||
"kind": { | ||
"group": "batch", | ||
"version": "v1", | ||
"kind": "CronJob" | ||
}, | ||
"resource": { | ||
"group": "batch", | ||
"version": "v1", | ||
"resource": "cronjobs" | ||
}, | ||
"requestKind": { | ||
"group": "batch", | ||
"version": "v1", | ||
"kind": "CronJob" | ||
}, | ||
"requestResource": { | ||
"group": "batch", | ||
"version": "v1", | ||
"resource": "cronjobs" | ||
}, | ||
"name": "testjob", | ||
"namespace": "antivax", | ||
"operation": "CREATE", | ||
"userInfo": { | ||
"username": "jorge.diaz", | ||
"uid": "jorge.diaz", | ||
"groups": [ | ||
"admin", | ||
"system:authenticated" | ||
] | ||
}, | ||
"object": { | ||
"kind": "CronJob", | ||
"apiVersion": "batch/v1", | ||
"metadata": { | ||
"name": "testjob", | ||
"namespace": "antivax", | ||
"creationTimestamp": null, | ||
"annotations": { | ||
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"batch/v1\",\"kind\":\"CronJob\",\"metadata\":{\"annotations\":{},\"name\":\"testjob\",\"namespace\":\"antivax\"},\"spec\":{\"jobTemplate\":{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"command\":[\"/bin/sh\",\"-c\",\"date; echo Hello!\"],\"image\":\"busybox:latest\",\"imagePullPolicy\":\"IfNotPresent\",\"name\":\"testjob\"}],\"restartPolicy\":\"OnFailure\"}}}},\"schedule\":\"* * * * *\"}}\n" | ||
}, | ||
"managedFields": [ | ||
{ | ||
"manager": "kubectl-client-side-apply", | ||
"operation": "Update", | ||
"apiVersion": "batch/v1", | ||
"time": "2024-02-09T12:24:24Z", | ||
"fieldsType": "FieldsV1", | ||
"fieldsV1": { | ||
"f:metadata": { | ||
"f:annotations": { | ||
".": {}, | ||
"f:kubectl.kubernetes.io/last-applied-configuration": {} | ||
} | ||
}, | ||
"f:spec": { | ||
"f:concurrencyPolicy": {}, | ||
"f:failedJobsHistoryLimit": {}, | ||
"f:jobTemplate": { | ||
"f:spec": { | ||
"f:template": { | ||
"f:spec": { | ||
"f:containers": { | ||
"k:{\"name\":\"testjob\"}": { | ||
".": {}, | ||
"f:command": {}, | ||
"f:image": {}, | ||
"f:imagePullPolicy": {}, | ||
"f:name": {}, | ||
"f:resources": {}, | ||
"f:terminationMessagePath": {}, | ||
"f:terminationMessagePolicy": {} | ||
} | ||
}, | ||
"f:dnsPolicy": {}, | ||
"f:restartPolicy": {}, | ||
"f:schedulerName": {}, | ||
"f:securityContext": {}, | ||
"f:terminationGracePeriodSeconds": {} | ||
} | ||
} | ||
} | ||
}, | ||
"f:schedule": {}, | ||
"f:successfulJobsHistoryLimit": {}, | ||
"f:suspend": {} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"spec": { | ||
"schedule": "* * * * *", | ||
"concurrencyPolicy": "Allow", | ||
"suspend": false, | ||
"jobTemplate": { | ||
"metadata": { | ||
"creationTimestamp": null, | ||
"annotations": { | ||
"linkerd.io/inject": "enabled" | ||
} | ||
}, | ||
"spec": { | ||
"template": { | ||
"metadata": { | ||
"creationTimestamp": null | ||
}, | ||
"spec": { | ||
"containers": [ | ||
{ | ||
"name": "testjob", | ||
"image": "busybox:latest", | ||
"command": [ | ||
"/bin/sh", | ||
"-c", | ||
"date; echo Hello!" | ||
], | ||
"resources": {}, | ||
"terminationMessagePath": "/dev/termination-log", | ||
"terminationMessagePolicy": "File", | ||
"imagePullPolicy": "IfNotPresent" | ||
} | ||
], | ||
"restartPolicy": "OnFailure", | ||
"terminationGracePeriodSeconds": 30, | ||
"dnsPolicy": "ClusterFirst", | ||
"securityContext": {}, | ||
"schedulerName": "default-scheduler" | ||
} | ||
} | ||
} | ||
}, | ||
"successfulJobsHistoryLimit": 3, | ||
"failedJobsHistoryLimit": 1 | ||
}, | ||
"status": {} | ||
}, | ||
"oldObject": null, | ||
"dryRun": false, | ||
"options": { | ||
"kind": "CreateOptions", | ||
"apiVersion": "meta.k8s.io/v1", | ||
"fieldManager": "kubectl-client-side-apply", | ||
"fieldValidation": "Strict" | ||
} | ||
} | ||
} |