From d9f7eacac1a8b02a6c43e694359c382bf9cc287d Mon Sep 17 00:00:00 2001 From: Christos Arvanitis Date: Wed, 11 Dec 2024 17:10:34 +0200 Subject: [PATCH] fix(ecs): Docker image extraction from context (#4812) (cherry picked from commit 266ce738a8ac46399b920885426a24a2f0e92dee) --- .../tasks/providers/ecs/EcsServerGroupCreator.groovy | 4 ++-- .../tasks/providers/ecs/EcsServerGroupCreatorSpec.groovy | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/clouddriver/tasks/providers/ecs/EcsServerGroupCreator.groovy b/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/clouddriver/tasks/providers/ecs/EcsServerGroupCreator.groovy index 1377222925..fdd91d1326 100644 --- a/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/clouddriver/tasks/providers/ecs/EcsServerGroupCreator.groovy +++ b/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/clouddriver/tasks/providers/ecs/EcsServerGroupCreator.groovy @@ -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() } } @@ -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() } } diff --git a/orca-clouddriver/src/test/groovy/com/netflix/spinnaker/orca/clouddriver/tasks/providers/ecs/EcsServerGroupCreatorSpec.groovy b/orca-clouddriver/src/test/groovy/com/netflix/spinnaker/orca/clouddriver/tasks/providers/ecs/EcsServerGroupCreatorSpec.groovy index e10ec2ce0e..330f77ce6f 100644 --- a/orca-clouddriver/src/test/groovy/com/netflix/spinnaker/orca/clouddriver/tasks/providers/ecs/EcsServerGroupCreatorSpec.groovy +++ b/orca-clouddriver/src/test/groovy/com/netflix/spinnaker/orca/clouddriver/tasks/providers/ecs/EcsServerGroupCreatorSpec.groovy @@ -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 @@ -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