Skip to content

Commit

Permalink
fix(ecs): Docker image extraction from context (#4812)
Browse files Browse the repository at this point in the history
(cherry picked from commit 266ce73)
  • Loading branch information
christosarvanitis authored and mergify[bot] committed Dec 11, 2024
1 parent ede90eb commit d9f7eac
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 d9f7eac

Please sign in to comment.