Skip to content

Commit

Permalink
fix(FindImageFromCluster): update context with inferred regions (#3508)
Browse files Browse the repository at this point in the history
* fix(FindImageFromCluster): update context with inferred regions

* fix(FindImageFromCluster): update context with inferred regions

Update orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/clouddriver/tasks/cluster/FindImageFromClusterTask.groovy

Co-Authored-By: Mark Vulfson <markvu@live.com>

Co-authored-by: Mark Vulfson <markvu@live.com>
  • Loading branch information
asher and marchello2000 committed Mar 12, 2020
1 parent 13b4ce9 commit 96384a3
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,16 @@ class FindImageFromClusterTask extends AbstractCloudProviderAwareTask implements
return artifact
}.flatten()

return TaskResult.builder(ExecutionStatus.SUCCEEDED).context([
amiDetails: deploymentDetails,
artifacts: artifacts
]).outputs([
deploymentDetails: deploymentDetails
// When additional regions are inferred for downstream deploy stages, adding them back
// to Stage.context.regions enables direct use via DeploymentDetailsAware.withImageFromPrecedingStage()
// instead of via a subsequent code path that may exhibit different behavior.
Map<String, Object> context = [amiDetails: deploymentDetails, artifacts: artifacts]
context.put("regions", config.regions + inferredRegions)
return TaskResult.builder(ExecutionStatus.SUCCEEDED).context(
context
).outputs([
deploymentDetails: deploymentDetails,
inferredRegions: inferredRegions
]).build()
}

Expand Down

0 comments on commit 96384a3

Please sign in to comment.