From d8af8474f017cee191526bd2bcd6dcedaa4b6037 Mon Sep 17 00:00:00 2001 From: Ben Meier Date: Fri, 29 Nov 2024 10:26:51 +0000 Subject: [PATCH] feat: make the container spec optional and support top level extensions Signed-off-by: Ben Meier --- samples/score-minimal.yaml | 3 +++ samples/score-with-extensions.yaml | 10 ++++++++++ score-v1b1.json | 12 +++++++++--- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 samples/score-minimal.yaml create mode 100644 samples/score-with-extensions.yaml diff --git a/samples/score-minimal.yaml b/samples/score-minimal.yaml new file mode 100644 index 0000000..edecce3 --- /dev/null +++ b/samples/score-minimal.yaml @@ -0,0 +1,3 @@ +apiVersion: score.dev/v1b1 +metadata: + name: example-workload-name123 diff --git a/samples/score-with-extensions.yaml b/samples/score-with-extensions.yaml new file mode 100644 index 0000000..5226c1a --- /dev/null +++ b/samples/score-with-extensions.yaml @@ -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 diff --git a/score-v1b1.json b/score-v1b1.json index 4de147a..f7a06ea 100644 --- a/score-v1b1.json +++ b/score-v1b1.json @@ -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.", @@ -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" },