diff --git a/builder/azure/arm/builder.go b/builder/azure/arm/builder.go index 24435b4c0..56ed25e45 100644 --- a/builder/azure/arm/builder.go +++ b/builder/azure/arm/builder.go @@ -157,7 +157,9 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack } } if foundMandatoryReplicationRegion == false { - return nil, fmt.Errorf("SIG requires that replication regions %v include the region %s in which the Managed Image resides", b.config.SharedGalleryDestination.SigDestinationReplicationRegions, b.config.manageImageLocation) + // return nil, fmt.Errorf("SIG requires that replication regions %v include the region %s in which the Managed Image resides", b.config.SharedGalleryDestination.SigDestinationReplicationRegions, b.config.manageImageLocation) + b.stateBag.Put(constants.ArmManagedImageSharedGalleryReplicationRegions, append(b.config.SharedGalleryDestination.SigDestinationReplicationRegions, b.config.manageImageLocation)) + ui.Say(fmt.Sprintf("Adding Managed Image region SIG replications regions %v", b.config.SharedGalleryDestination.SigDestinationReplicationRegions)) } } @@ -398,7 +400,6 @@ func (b *Builder) configureStateBag(stateBag multistep.StateBag) { stateBag.Put(constants.ArmManagedImageSharedGalleryName, b.config.SharedGalleryDestination.SigDestinationGalleryName) stateBag.Put(constants.ArmManagedImageSharedGalleryImageName, b.config.SharedGalleryDestination.SigDestinationImageName) stateBag.Put(constants.ArmManagedImageSharedGalleryImageVersion, b.config.SharedGalleryDestination.SigDestinationImageVersion) - stateBag.Put(constants.ArmManagedImageSharedGalleryReplicationRegions, b.config.SharedGalleryDestination.SigDestinationReplicationRegions) stateBag.Put(constants.ArmManagedImageSubscription, b.config.SubscriptionID) } } diff --git a/builder/azure/arm/step_publish_to_shared_image_gallery.go b/builder/azure/arm/step_publish_to_shared_image_gallery.go index efb458854..926e4d705 100644 --- a/builder/azure/arm/step_publish_to_shared_image_gallery.go +++ b/builder/azure/arm/step_publish_to_shared_image_gallery.go @@ -95,7 +95,7 @@ func (s *StepPublishToSharedImageGallery) Run(ctx context.Context, stateBag mult var miSIGalleryName = stateBag.Get(constants.ArmManagedImageSharedGalleryName).(string) var miSGImageName = stateBag.Get(constants.ArmManagedImageSharedGalleryImageName).(string) var miSGImageVersion = stateBag.Get(constants.ArmManagedImageSharedGalleryImageVersion).(string) - var location = stateBag.Get(constants.ArmLocation).(string) + var location = stateBag.Get(constants.ArmManagedImageLocation).(string) var tags = stateBag.Get(constants.ArmTags).(map[string]*string) var miSigReplicationRegions = stateBag.Get(constants.ArmManagedImageSharedGalleryReplicationRegions).([]string) var targetManagedImageResourceGroupName = stateBag.Get(constants.ArmManagedImageResourceGroupName).(string)