Skip to content

Commit 0377221

Browse files
committed
schema: allow the "type" property for composable images
1 parent 91d87ed commit 0377221

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

validator/schema/upsun.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
"firewall": {"$ref": "#/definitions/firewall"},
4343
"type": {
4444
"type": "string",
45-
"title": "The base runtime (language) and version to use for this application",
46-
"description": "The base image to use with a specific app language. \nFormat: runtime:version. \nMore information: \nhttps://docs.upsun.com/create-apps/app-reference/single-runtime-image.html#types"
45+
"title": "The base runtime and version to use for this application",
46+
"description": "The base image to use. \nFormat: runtime:version. \nMore information: \nhttps://docs.upsun.com/create-apps/app-reference/single-runtime-image.html#types"
4747
},
4848
"runtime": {
4949
"type": "object",
@@ -705,23 +705,22 @@
705705
"type": "object"
706706
}
707707
]
708-
}
708+
},
709+
"description": "A package definition, for example 'package@version' (for services) or just 'package' (for tools)."
709710
}
710711
],
711712
"title": "Composable Image definition",
712-
"description": "A list of packages from the Upsun collection of supported runtimes and/or from NixPkgs. \nMore information: \nhttps://docs.upsun.com/create-apps/app-reference/composable-image.html"
713-
}
713+
"description": "A list of Nix packages from NixPkgs. \nMore information: \nhttps://docs.upsun.com/create-apps/app-reference/composable-image.html" }
714714
},
715-
"oneOf": [
715+
"anyOf": [
716716
{
717-
"required": [
718-
"type"
719-
]
717+
"required": ["type"]
720718
},
721719
{
722-
"required": [
723-
"stack"
724-
]
720+
"required": ["stack"]
721+
},
722+
{
723+
"required": ["type", "stack"]
725724
}
726725
],
727726
"additionalProperties": false

validator/validator_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ services:
171171
Data: []byte(`
172172
applications:
173173
app1:
174-
type: "python:3.11"
174+
type: "composable:25.05"
175175
stack:
176176
177177
extensions:
@@ -195,7 +195,7 @@ services:
195195
},
196196
},
197197
},
198-
wantErr: true,
198+
wantErr: false,
199199
},
200200
{
201201
name: "true-boolean",

0 commit comments

Comments
 (0)