Description
The execProbe definition requires command and types it as an array of strings, but has no minItems constraint:
"command": {
"type": "array",
"items": { "type": "string" }
}
In score-v1b1.json
An empty command: [] passes schema validation but is guaranteed to fail at runtime in every container runtime. This is a classic "valid schema, broken deploy" scenario.
Expected behavior
command should require at least one element: "minItems": 1.
Steps to reproduce
Put this in a score YAML and validate:
apiVersion: score.dev/v1b1
metadata:
name: empty-command-bug
containers:
main:
image: my-app
livenessProbe:
exec:
command: []
Validate:
bashjv --assert-format --assert-content ./score-v1b1.json score-empty-command.yaml
Schema validation passes with no error.
Screenshots
NA
Context
I was writing a score.yaml incrementally and used command: [] as a placeholder while figuring out the right probe command. I expected the schema validator to catch it as a clear structural error and flag it so I'd remember to fill it in. It passed silently. This is the kind of thing that would only surface at runtime when kubelet tries to execute an empty command, which is much later than schema validation should allow.
Additional information
I confirmed this passes both the project's jv validator and make test-examples when placed in the samples directory. The Kubernetes API server itself rejects an empty command array on exec probes with "Invalid value: []string(nil)". The same missing minItems issue also exists on container.command (L289) and container.args (L295), though those are optional fields so the impact is lower there.
Description
The execProbe definition requires command and types it as an array of strings, but has no minItems constraint:
In score-v1b1.json
An empty command: [] passes schema validation but is guaranteed to fail at runtime in every container runtime. This is a classic "valid schema, broken deploy" scenario.
Expected behavior
command should require at least one element: "minItems": 1.
Steps to reproduce
Put this in a score YAML and validate:
Validate:
bashjv --assert-format --assert-content ./score-v1b1.json score-empty-command.yamlSchema validation passes with no error.
Screenshots
NA
Context
I was writing a score.yaml incrementally and used command: [] as a placeholder while figuring out the right probe command. I expected the schema validator to catch it as a clear structural error and flag it so I'd remember to fill it in. It passed silently. This is the kind of thing that would only surface at runtime when kubelet tries to execute an empty command, which is much later than schema validation should allow.
Additional information
I confirmed this passes both the project's jv validator and make test-examples when placed in the samples directory. The Kubernetes API server itself rejects an empty command array on exec probes with "Invalid value: []string(nil)". The same missing minItems issue also exists on container.command (L289) and container.args (L295), though those are optional fields so the impact is lower there.