Skip to content

Commit 379cab8

Browse files
Include arches to build metadata
For some older versions like v4.12, OCP has stopped building the binary image for a couple of arches. Index image should follow suite. Include arches in the build metadata so the builder task can build the index image accordingly. Signed-off-by: Yashvardhan Nanavati <yashn@bu.edu> Assisted-by: Cursor
1 parent 33d5303 commit 379cab8

File tree

5 files changed

+10
-1
lines changed

5 files changed

+10
-1
lines changed

iib/workers/tasks/build_containerized_create_empty_index.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ def handle_containerized_create_empty_index_request(
270270
distribution_scope,
271271
binary_image_resolved,
272272
request_id,
273+
arches,
273274
)
274275

275276
# Add custom labels to metadata file if provided

iib/workers/tasks/build_containerized_fbc_operations.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ def handle_containerized_fbc_operation_request(
169169
distribution_scope,
170170
binary_image_resolved,
171171
request_id,
172+
arches,
172173
)
173174

174175
try:

iib/workers/tasks/build_containerized_rm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ def handle_containerized_rm_request(
220220
distribution_scope,
221221
binary_image_resolved,
222222
request_id,
223+
arches,
223224
)
224225

225226
try:

iib/workers/tasks/containerized_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,19 +169,21 @@ def write_build_metadata(
169169
distribution_scope: str,
170170
binary_image: str,
171171
request_id: int,
172+
arches: set,
172173
) -> None:
173174
"""
174175
Write build metadata file for Konflux build task.
175176
176177
This function creates a JSON metadata file that contains information needed by the
177-
Konflux build task, including OPM version, labels, binary image, and request ID.
178+
Konflux build task, including OPM version, labels, binary image, request ID, and arches.
178179
179180
:param str local_repo_path: Path to local Git repository
180181
:param str opm_version: OPM version string (e.g., "opm-1.40.0")
181182
:param str ocp_version: OCP version (e.g., "v4.19")
182183
:param str distribution_scope: Distribution scope (e.g., "PROD")
183184
:param str binary_image: Binary image pullspec
184185
:param int request_id: Request ID
186+
:param set arches: Set of architectures (e.g., {'amd64', 's390x'})
185187
"""
186188
metadata = {
187189
'opm_version': opm_version,
@@ -191,6 +193,7 @@ def write_build_metadata(
191193
},
192194
'binary_image': binary_image,
193195
'request_id': request_id,
196+
'arches': sorted(list(arches)),
194197
}
195198

196199
metadata_path = os.path.join(local_repo_path, '.iib-build-metadata.json')

tests/test_workers/test_tasks/test_containerized_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def test_write_build_metadata_creates_expected_json(mock_log, tmp_path):
168168
distribution_scope = 'PROD'
169169
binary_image = 'quay.io/ns/binary-image:tag'
170170
request_id = 12345
171+
arches = {'amd64', 's390x'}
171172

172173
write_build_metadata(
173174
str(local_repo_path),
@@ -176,6 +177,7 @@ def test_write_build_metadata_creates_expected_json(mock_log, tmp_path):
176177
distribution_scope,
177178
binary_image,
178179
request_id,
180+
arches,
179181
)
180182

181183
metadata_path = local_repo_path / '.iib-build-metadata.json'
@@ -192,6 +194,7 @@ def test_write_build_metadata_creates_expected_json(mock_log, tmp_path):
192194
},
193195
'binary_image': binary_image,
194196
'request_id': request_id,
197+
'arches': ['amd64', 's390x'],
195198
}
196199

197200
mock_log.info.assert_called_once_with('Written build metadata to %s', str(metadata_path))

0 commit comments

Comments
 (0)