Last active
March 22, 2020 20:43
-
-
Save onelittlenightmusic/4efde74611d6ebe05e2e63a1ea03615e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
main = { #Start of value | |
"apiVersion": "admission.k8s.io/v1beta1", | |
"kind": "AdmissionReview", | |
"response": { | |
"allowed": true, | |
"patchType": "JSONPatch", | |
"patch": patch_bytes, | |
} | |
} #End of value | |
{ #Start of condition | |
is_create_or_update | |
input.request.object.metadata.annotations["test-mutation"] | |
patch = [ | |
{"op": "add", "path": "/metadata/annotations/foo", "value": "bar"}, | |
] | |
patch_json = json.marshal(patch) | |
patch_bytes = base64url.encode(patch_json) | |
} #End of condition |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment