Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ecs): Docker image extraction from context (backport #4812) #4813

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading