Skip to content

Commit

Permalink
Fix deprecated replicated_regions not using global replica count for …
Browse files Browse the repository at this point in the history
…base region (#438)
  • Loading branch information
JenGoldstrich authored Aug 22, 2024
1 parent 4d2a020 commit b7642d6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions builder/azure/arm/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,16 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
for _, region := range b.config.SharedGalleryDestination.SigDestinationReplicationRegions {
region := normalizeAzureRegion(region)
if strings.EqualFold(region, buildLocation) {
// backwards compatibility DiskEncryptionSetId was set on the global config not on the target region.
// Users using target_region blocks are responsible for setting the DES within the block
normalizedRegions = append(normalizedRegions, TargetRegion{Name: region, DiskEncryptionSetId: b.config.DiskEncryptionSetId})
normalizedRegions = append(
normalizedRegions, TargetRegion{
Name: region,
// backwards compatibility DiskEncryptionSetId was set on the global config not on the target region.
// Users using target_region blocks are responsible for setting the DES within the block
DiskEncryptionSetId: b.config.DiskEncryptionSetId,

ReplicaCount: b.config.SharedGalleryImageVersionReplicaCount,
},
)
foundMandatoryReplicationRegion = true
continue
}
Expand Down

0 comments on commit b7642d6

Please sign in to comment.