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 replicated_regions not using shared_image_gallery_replica_count for build location when its specified in the list #438

Merged
Merged
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
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