Skip to content

Commit aaae5a5

Browse files
authored
fix common stage build (#4827)
1 parent 56c7466 commit aaae5a5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/image_builder.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def image_builder(buildspec, image_types=[], device_types=[]):
373373
# inside function get_common_stage_image_object we make pre_push_stage_image_object non pushable.
374374
if image_config.get("enable_common_stage_build", True):
375375
common_stage_image_object = generate_common_stage_image_object(
376-
pre_push_stage_image_object, image_tag
376+
pre_push_stage_image_object, image_tag, cache_from_tag
377377
)
378378
COMMON_STAGE_IMAGES.append(common_stage_image_object)
379379

@@ -477,7 +477,7 @@ def process_images(pre_push_image_list, pre_push_image_type="Pre-push", buildspe
477477
return images_to_push
478478

479479

480-
def generate_common_stage_image_object(pre_push_stage_image_object, image_tag):
480+
def generate_common_stage_image_object(pre_push_stage_image_object, image_tag, cache_from_tag):
481481
"""
482482
Creates a common stage image object for a pre_push stage image. If for a pre_push stage image we create a common
483483
stage image, then we do not push the pre_push stage image to the repository. Instead, we just push its common stage
@@ -499,6 +499,7 @@ def generate_common_stage_image_object(pre_push_stage_image_object, image_tag):
499499
tag=append_tag(image_tag, "multistage-common"),
500500
to_build=pre_push_stage_image_object.to_build,
501501
stage=constants.COMMON_STAGE,
502+
cache_from_tag=cache_from_tag,
502503
additional_tags=pre_push_stage_image_object.additional_tags,
503504
)
504505
pre_push_stage_image_object.to_push = False

0 commit comments

Comments
 (0)