Skip to content

Commit 1303782

Browse files
committed
Make repo content sync configurable [RHELDST-34407]
Currently, the configuration of the source repositories for content sync from RHEL to UBI is hardcoded in cdn-utils, and the same goes also for Client Tools. This makes any addition of more synced content difficult, as it requires tooling changes and deployment each time. Additionally, `populate_ubi_dot_repos` isn't flexible enough because it doesn't allow for selective control over which products have their content populated in the DOT repos and in which environments. This commit adds `repo_content_sync` configuration that allows to set the content synchronization per-environment. It accepts a list of git repo paths containing the configuration for tooling that facilitates the repo content sync (currently ubipop) and a flag that controls DOT repo population per-source.
1 parent 1023b97 commit 1303782

File tree

4 files changed

+92
-4
lines changed

4 files changed

+92
-4
lines changed

src/cdn_definitions/data.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@
9999
"override_initial_rhel_release": {
100100
"0": "0.0"
101101
},
102-
"populate_ubi_dot_repos": true,
103102
"release_stream_mappings": {
104103
"aus": [
105104
"0.0"
@@ -127,6 +126,28 @@
127126
"src": "/content/dist/rhel1/1"
128127
}
129128
],
129+
"repo_content_sync": {
130+
"prod": [
131+
{
132+
"populate_dot_repos": false,
133+
"source": "https://example.com/ubi/data"
134+
},
135+
{
136+
"populate_dot_repos": true,
137+
"source": "https://example.com/client-tools/data"
138+
}
139+
],
140+
"stage": [
141+
{
142+
"populate_dot_repos": false,
143+
"source": "https://example.com/ubi/data"
144+
},
145+
{
146+
"populate_dot_repos": true,
147+
"source": "https://example.com/client-tools/data"
148+
}
149+
]
150+
},
130151
"repo_overrides": {
131152
"prod": [
132153
{

src/cdn_definitions/data.yaml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,26 @@ exclude_from_listings:
222222
rhel_open_dist:
223223
- 0
224224

225-
# If set to False, ubi_population repo note will be set False for all ubi DOT repos and
226-
# no ubi DOT repo will be populated.
227-
populate_ubi_dot_repos: True
225+
# repo_content_sync configures selective content synchronization from RHEL repos to other products.
226+
# It is used e.g. by UBI to sync content to Public CDN.
227+
repo_content_sync:
228+
stage:
229+
# Source git repo contains the configuration for tooling that facilitates
230+
# the repo content sync (currently ubipop).
231+
# The configuration includes content set labels and lists with allowed and blocked packages.
232+
- source: https://example.com/ubi/data
233+
# If set to False, ubi_population repo note will be set False for all DOT repos and
234+
# no output DOT repo belonging under the content set defined in the source git repo
235+
# will be populated. Only the mainline repos will be populated. If set to True, all DOT repos
236+
# will be populated alongside the mainline repos.
237+
populate_dot_repos: False
238+
- source: https://example.com/client-tools/data
239+
populate_dot_repos: True
240+
prod:
241+
- source: https://example.com/ubi/data
242+
populate_dot_repos: False
243+
- source: https://example.com/client-tools/data
244+
populate_dot_repos: True
228245

229246
# repo_overrides can be used to define mappings between certain criteria matching CDN repos
230247
# and configuration which should be set on those repos. The intended usage is to allow

src/cdn_definitions/schema.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,30 @@
261261
"type": "array",
262262
"uniqueItems": true
263263
},
264+
"repo_content_sync": {
265+
"additionalProperties": false,
266+
"patternProperties": {
267+
".*": {
268+
"items": {
269+
"$ref": "#/definitions/repo_content_sync_record"
270+
},
271+
"type": "array"
272+
}
273+
},
274+
"type": "object"
275+
},
276+
"repo_content_sync_record": {
277+
"additionalProperties": false,
278+
"properties": {
279+
"populate_dot_repos": {
280+
"type": "boolean"
281+
},
282+
"source": {
283+
"type": "string"
284+
}
285+
},
286+
"type": "object"
287+
},
264288
"repo_override": {
265289
"additionalProperties": false,
266290
"allOf": [
@@ -442,6 +466,9 @@
442466
"releasever_alias": {
443467
"$ref": "#/definitions/path_alias_list"
444468
},
469+
"repo_content_sync": {
470+
"$ref": "#/definitions/repo_content_sync"
471+
},
445472
"repo_overrides": {
446473
"$ref": "#/definitions/repo_overrides"
447474
},

src/cdn_definitions/schema.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,24 @@ definitions:
270270
$ref: "#/definitions/repo_override"
271271
additionalProperties: false
272272

273+
repo_content_sync_record:
274+
type: object
275+
properties:
276+
source:
277+
type: string
278+
populate_dot_repos:
279+
type: boolean
280+
additionalProperties: false
281+
282+
repo_content_sync:
283+
type: object
284+
patternProperties:
285+
".*":
286+
type: array
287+
items:
288+
$ref: "#/definitions/repo_content_sync_record"
289+
additionalProperties: false
290+
273291
directory_layout:
274292
type: object
275293
properties:
@@ -358,6 +376,7 @@ properties:
358376
rhel_open_dist:
359377
$ref: "#/definitions/major_version_list"
360378

379+
# Deprecated by rhui_product_ids
361380
rhui_product_id:
362381
$ref: "#/definitions/product_id"
363382

@@ -370,9 +389,13 @@ properties:
370389
exclude_from_listings:
371390
$ref: "#/definitions/exclude_versions_from_listings"
372391

392+
# Deprecated by repo_content_sync
373393
populate_ubi_dot_repos:
374394
type: boolean
375395

396+
repo_content_sync:
397+
$ref: "#/definitions/repo_content_sync"
398+
376399
repo_overrides:
377400
$ref: "#/definitions/repo_overrides"
378401

0 commit comments

Comments
 (0)