Skip to content

Commit

Permalink
Add remote_sources_version into container.yaml
Browse files Browse the repository at this point in the history
This will allow users to pick version fo remote_sources feature which
should be used.

Signed-off-by: Martin Basti <[email protected]>
  • Loading branch information
MartinBasti committed Nov 18, 2024
1 parent 628b070 commit d783ebc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions osbs/schemas/container.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"tags": {"$ref": "#/definitions/tags"},
"set_release_env": {"$ref": "#/definitions/set_release_env"},
"version": {"$ref": "#/definitions/version"},
"remote_sources_version": {"$ref": "#/definitions/remote_sources_version"},
"go": {"$ref": "#/definitions/go"}
},
"additionalProperties": false
Expand All @@ -33,6 +34,7 @@
"tags": {"$ref": "#/definitions/tags"},
"set_release_env": {"$ref": "#/definitions/set_release_env"},
"version": {"$ref": "#/definitions/version"},
"remote_sources_version": {"$ref": "#/definitions/remote_sources_version"},
"remote_source": {"$ref": "#/definitions/remote_source"}
},
"additionalProperties": false
Expand All @@ -49,6 +51,7 @@
"tags": {"$ref": "#/definitions/tags"},
"set_release_env": {"$ref": "#/definitions/set_release_env"},
"version": {"$ref": "#/definitions/version"},
"remote_sources_version": {"$ref": "#/definitions/remote_sources_version"},
"remote_sources": {"$ref": "#/definitions/remote_sources"}
},
"additionalProperties": false
Expand Down Expand Up @@ -438,6 +441,14 @@
}
},
"additionalProperties": false
},
"remote_sources_version": {
"type": "number",
"description": "Feature version of remote sources",
"examples": [1, 2],
"minimum": 1,
"maximum": 2,
"default": 1
}
}
}
8 changes: 8 additions & 0 deletions tests/utils/test_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,14 @@ def test_validate_with_schema_bad_schema(caplog):
),
r"Additional properties are not allowed \('additional_property' was unexpected\)",
),
(
(
"""
remote_sources_version: 40
"""
),
r"40 is greater than the maximum of 2",
),
],
)
def test_invalid_remote_sources_schema(config, err_message, caplog):
Expand Down

0 comments on commit d783ebc

Please sign in to comment.