Skip to content

Commit

Permalink
fix(ecs): Docker image extraction from context (#4812) (#4813)
Browse files Browse the repository at this point in the history
(cherry picked from commit 266ce73)

Co-authored-by: Christos Arvanitis <[email protected]>
  • Loading branch information
mergify[bot] and christosarvanitis authored Dec 11, 2024
1 parent ede90eb commit 87141f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class EcsServerGroupCreator implements ServerGroupCreator, DeploymentDetailsAwar
def bakeStage = getPreviousStageWithImage(stage, operation.region, cloudProvider)

if (bakeStage) {
operation.dockerImageAddress = bakeStage.context.amiDetails.imageId.value.get(0).toString()
operation.dockerImageAddress = bakeStage.context.amiDetails.collect(it->it.imageId).get(0).toString()
}
}

Expand Down Expand Up @@ -216,7 +216,7 @@ class EcsServerGroupCreator implements ServerGroupCreator, DeploymentDetailsAwar
throw new IllegalStateException("No image stage found in context for $description.imageLabelOrSha.")
}

description.imageId = imageStage.context.amiDetails.imageId.value.get(0).toString()
description.imageId = imageStage.context.amiDetails.collect(it->it.imageId).get(0).toString()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class EcsServerGroupCreatorSpec extends Specification {
def parentStage = stage {}
parentStage.id = parentStageId
parentStage.refId = parentStageId
parentStage.context.amiDetails = [imageId: [value: ["$testReg/$testRepo:$testTag"]]]
parentStage.context.amiDetails = List.of(Map.of("imageId","$testReg/$testRepo:$testTag"))

stage.context.imageDescription = testDescription
stage.parentStageId = parentStageId
Expand Down Expand Up @@ -120,7 +120,7 @@ class EcsServerGroupCreatorSpec extends Specification {
parentStage.id = parentStageId
parentStage.context.region = testRegion
parentStage.context.cloudProviderType = "ecs"
parentStage.context.amiDetails = [imageId: [value: ["$testReg/$testRepo:$testTag"]]]
parentStage.context.amiDetails = List.of(Map.of("imageId","$testReg/$testRepo:$testTag"))

stage.context.region = testRegion
stage.parentStageId = parentStageId
Expand Down

0 comments on commit 87141f2

Please sign in to comment.