Skip to content

Commit

Permalink
feat(schema): added exec probe and mutual exclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
astromechza committed Nov 29, 2024
1 parent 88eda74 commit 9f70208
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions samples/score-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 21 additions & 2 deletions score-v1b1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
},
Expand Down

0 comments on commit 9f70208

Please sign in to comment.