From 9f70208173fc8f1584f0a74f94b32d148ebb904a Mon Sep 17 00:00:00 2001 From: Ben Meier Date: Fri, 29 Nov 2024 11:22:01 +0000 Subject: [PATCH] feat(schema): added exec probe and mutual exclusion --- Makefile | 2 +- samples/score-full.yaml | 8 +++++--- score-v1b1.json | 23 +++++++++++++++++++++-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 28b2daa..b2b9177 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ test-examples: ${GOPATH}/bin/jv ifeq ($(SCORE_EXAMPLES_DIR),) $(error SCORE_EXAMPLES_DIR must be set) endif - find ${SCORE_EXAMPLES_DIR} -name 'score*.yaml' -print -exec ${GOPATH}/bin/jv --assert-format --assert-content ./score-v1b1.json {} \; + for f in $$(find ${SCORE_EXAMPLES_DIR} -name 'score*.yaml' -print); do ${GOPATH}/bin/jv --assert-format --assert-content ./score-v1b1.json $$f; done @echo "Schema matches all samples" ## Run all tests diff --git a/samples/score-full.yaml b/samples/score-full.yaml index 8b51d2b..693634c 100644 --- a/samples/score-full.yaml +++ b/samples/score-full.yaml @@ -42,9 +42,11 @@ containers: - source: volume-two target: /mnt/something-else livenessProbe: - httpGet: - port: 8080 - path: /livez + exec: + command: + - /bin/bash + - -c + - "true" readinessProbe: httpGet: host: 127.0.0.1 diff --git a/score-v1b1.json b/score-v1b1.json index 94d8364..3bdc6c3 100644 --- a/score-v1b1.json +++ b/score-v1b1.json @@ -338,13 +338,32 @@ }, "containerProbe": { "type": "object", - "required": [ - "httpGet" + "oneOf": [ + {"required": ["httpGet"]}, + {"required": ["exec"]} ], "additionalProperties": false, "properties": { "httpGet": { "$ref": "#/$defs/httpProbe" + }, + "exec": { + "$ref": "#/$defs/execProbe" + } + } + }, + "execProbe": { + "description": "An executable health probe.", + "type": "object", + "additionalProperties": false, + "required": ["command"], + "properties": { + "command": { + "description": "The command and arguments to execute within the container.", + "type": "array", + "items": { + "type": "string" + } } } },