Skip to content

Commit

Permalink
feat: make the container spec optional and support top level extensions
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Meier <[email protected]>
  • Loading branch information
astromechza committed Nov 29, 2024
1 parent 9417430 commit 177c9bf
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion samples/score-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ resources:
data: here
resource-two2:
type: Resource-Two
resource.three:
resource-three:
type: Type-Three
id: shared-type-three
3 changes: 3 additions & 0 deletions samples/score-minimal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
apiVersion: score.dev/v1b1
metadata:
name: example-workload-name123
10 changes: 10 additions & 0 deletions samples/score-with-extensions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: score.dev/v1b1
metadata:
name: example-workload-name123
x-my-extension:
archive: http://example.com/binary.tgz
variables:
SOME_VAR: ${resources.example.thing}
resources:
example:
type: resource-type
12 changes: 9 additions & 3 deletions score-v1b1.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
"type": "object",
"required": [
"apiVersion",
"metadata",
"containers"
"metadata"
],
"additionalProperties": false,
"patternProperties": {
"^x-.+": {
"description": "A top-level Score extention. This is a schema extension which is not defined by the common Score specification but may be supported by a subset of Score implementations. The 'x-' prefix avoid conflict with future top level fields in the Score specification.",
"type": "object",
"additionalProperties": true
}
},
"properties": {
"apiVersion": {
"description": "The declared Score Specification version.",
Expand Down Expand Up @@ -67,7 +73,7 @@
"containers": {
"description": "The set of named containers in the Workload. The container name must be a valid RFC1123 Label Name of up to 63 characters, including a-z, 0-9, '-' but may not start or end with '-'.",
"type": "object",
"minProperties": 0,
"minProperties": 1,
"additionalProperties": {
"$ref": "#/$defs/container"
},
Expand Down

0 comments on commit 177c9bf

Please sign in to comment.