Skip to content

Commit 3d1c24f

Browse files
thozzaondrejbudai
authored andcommitted
Hub: use anyOf for upload_options schema
It turned out, that the upload options for AWS EC2 or GCP with just the required properties specified, would match both schemas. This is causing the validation fail with `oneOf` used for `upload_options`. This will be fixed in osbuild-composer PR#3018. However, we can't use the same approach for koji-osbuild, while keeping the schema backward compatible and sane. Another discussed option would be to define `upload_options` as an empty object with `additionalProperties` set to `True`. This would effectively mean no validation of `upload_options`. None of the plugins actually modify the `upload_options` in any way. It is passed as provided to `osbuild-composer`. I think that the change in this commit is a compromise. The validation of the `upload_options` schema is kept, but it is relaxed to `anyOf`. [1] osbuild/osbuild-composer#3018 Signed-off-by: Tomáš Hozza <[email protected]>
1 parent 7ccd349 commit 3d1c24f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugins/hub/osbuild.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@
112112
"$ref": "#/definitions/ostree"
113113
},
114114
"upload_options": {
115-
"oneOf": [
115+
# this should be really 'oneOf', but the minimal required
116+
# properties in AWSEC2 and GCP options overlap.
117+
"anyOf": [
116118
{"$ref": "#/definitions/AWSEC2UploadOptions"},
117119
{"$ref": "#/definitions/AWSS3UploadOptions"},
118120
{"$ref": "#/definitions/GCPUploadOptions"},

0 commit comments

Comments
 (0)