From 540c904fd46c008bdcb1e79ff0d6824a1ae84379 Mon Sep 17 00:00:00 2001 From: Amrita Dutta Date: Mon, 17 Jun 2019 19:13:03 +0000 Subject: [PATCH] add missing check to not publish to SIG if config.SharedGalleryDestination.SigDestinationGalleryName is null --- builder/azure/arm/step_publish_to_shared_image_gallery.go | 4 ++++ 1 file changed, 4 insertions(+) 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 fb375de8b..a159be5f7 100644 --- a/builder/azure/arm/step_publish_to_shared_image_gallery.go +++ b/builder/azure/arm/step_publish_to_shared_image_gallery.go @@ -98,6 +98,10 @@ func (s *StepPublishToSharedImageGallery) publishToSig(ctx context.Context, miSi } func (s *StepPublishToSharedImageGallery) Run(ctx context.Context, stateBag multistep.StateBag) multistep.StepAction { + if !s.toSIG() { + return multistep.ActionContinue + } + s.say("Publishing to Shared Image Gallery ...") var miSigPubSubscription = stateBag.Get(constants.ArmManagedImageSigPublishSubscription).(string)