@@ -364,34 +364,29 @@ def build_image_generic(
364
364
dockerfile_path : str ,
365
365
build_configuration : BuildConfiguration ,
366
366
extra_args : dict | None = None ,
367
- multi_arch_args_list : list [dict ] | None = None ,
368
- is_multi_arch : bool = False ,
369
367
):
370
368
"""
371
369
Build one or more platform-specific images, then (optionally)
372
370
push a manifest and sign the result.
373
371
"""
374
372
375
373
registry = build_configuration .base_registry
376
- args_list = multi_arch_args_list or [extra_args or {}]
377
- version = args_list [0 ].get ("version" , "" )
378
- platforms = [args .get ("architecture" ) for args in args_list ]
379
-
380
- for base_args in args_list :
381
- # merge in the registry without mutating caller’s dict
382
- build_args = {** base_args , "quay_registry" : registry }
383
- logger .debug (f"Build args: { build_args } " )
384
-
385
- for arch in platforms :
386
- logger .debug (f"Building { image_name } for arch={ arch } " )
387
- logger .debug (f"build image generic - registry={ registry } " )
388
- pipeline_process_image (
389
- image_name = image_name ,
390
- dockerfile_path = dockerfile_path ,
391
- build_configuration = build_configuration ,
392
- dockerfile_args = build_args ,
393
- with_sbom = False , # TODO: specify no SBOM, write folllow up tasks and todo
394
- )
374
+ args_list = extra_args or {}
375
+ version = args_list .get ("version" , "" )
376
+
377
+ # merge in the registry without mutating caller’s dict
378
+ build_args = {** args_list , "quay_registry" : registry }
379
+ logger .debug (f"Build args: { build_args } " )
380
+
381
+ logger .debug (f"Building { image_name } for platforms={ build_configuration .platforms } " )
382
+ logger .debug (f"build image generic - registry={ registry } " )
383
+ pipeline_process_image (
384
+ image_name = image_name ,
385
+ dockerfile_path = dockerfile_path ,
386
+ build_configuration = build_configuration ,
387
+ dockerfile_args = build_args ,
388
+ with_sbom = False , # TODO: specify no SBOM, write folllow up tasks and todo
389
+ )
395
390
396
391
if build_configuration .sign :
397
392
sign_image (registry , version )
@@ -441,41 +436,21 @@ def build_community_image(build_configuration: BuildConfiguration, image_type: s
441
436
image_name = "mongodb-kubernetes-operator-version-upgrade-post-start-hook"
442
437
dockerfile_path = "docker/mongodb-kubernetes-upgrade-hook/Dockerfile"
443
438
else :
444
- raise ValueError (f"Unsupported image type: { image_type } " )
439
+ raise ValueError (f"Unsupported community image type: { image_type } " )
445
440
446
441
version = build_configuration .version
447
442
golang_version = os .getenv ("GOLANG_VERSION" , "1.24" )
448
443
449
- # Use only amd64 if we should skip arm64 builds
450
- if should_skip_arm64 ():
451
- platforms = ["linux/amd64" ]
452
- logger .info ("Skipping ARM64 builds for community image as this is running in EVG pipeline as a patch" )
453
- else :
454
- platforms = build_configuration .platforms or ["linux/amd64" , "linux/arm64" ]
455
-
456
- # Extract architectures from platforms for build args
457
- architectures = [platform .split ("/" )[- 1 ] for platform in platforms ]
458
- multi_arch_args_list = []
459
-
460
- for arch in architectures :
461
- arch_args = {
462
- "version" : version ,
463
- "GOLANG_VERSION" : golang_version ,
464
- "architecture" : arch ,
465
- "TARGETARCH" : arch , # TODO: redundant ?
466
- }
467
- multi_arch_args_list .append (arch_args )
468
-
469
- # Create a copy of build_configuration with overridden platforms
470
- build_config_copy = copy (build_configuration )
471
- build_config_copy .platforms = platforms
444
+ extra_args = {
445
+ "version" : version ,
446
+ "GOLANG_VERSION" : golang_version ,
447
+ }
472
448
473
449
build_image_generic (
474
450
image_name = image_name ,
475
451
dockerfile_path = dockerfile_path ,
476
- build_configuration = build_config_copy ,
477
- multi_arch_args_list = multi_arch_args_list ,
478
- is_multi_arch = True ,
452
+ build_configuration = build_configuration ,
453
+ extra_args = extra_args ,
479
454
)
480
455
481
456
0 commit comments