From ef1ed109e1630e39032c2cf6881ee6b3ede3c804 Mon Sep 17 00:00:00 2001 From: Ben Meier <1651305+astromechza@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:52:43 +0000 Subject: [PATCH] feat: Add new containerProbe type exec for command execution (#114) Signed-off-by: Ben Meier --- samples/score-full.yaml | 5 +++++ score-v1b1.json | 22 +++++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/samples/score-full.yaml b/samples/score-full.yaml index 8b51d2b..4b711a1 100644 --- a/samples/score-full.yaml +++ b/samples/score-full.yaml @@ -45,6 +45,11 @@ containers: httpGet: port: 8080 path: /livez + exec: + command: + - /bin/curl + - -f + - "http://localhost:8080/livez" readinessProbe: httpGet: host: 127.0.0.1 diff --git a/score-v1b1.json b/score-v1b1.json index 94d8364..1da1358 100644 --- a/score-v1b1.json +++ b/score-v1b1.json @@ -338,13 +338,29 @@ }, "containerProbe": { "type": "object", - "required": [ - "httpGet" - ], + "description": "The probe may be defined as either http, command execution, or both. The execProbe should be preferred if the Score implementation supports both types.", "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" + } } } },