Skip to content

Commit cabeafb

Browse files
Use Image ID if storage profile is unset rather than erroring for HCPP Ancestry (#479)
1 parent 34dcc2c commit cabeafb

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

builder/azure/arm/step_get_source_image_name.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ func (s *StepGetSourceImageName) Run(ctx context.Context, state multistep.StateB
7676
s.say(fmt.Sprintf(" -> SourceImageName: '%s'", parentSourceID))
7777
s.GeneratedData.Put("SourceImageName", parentSourceID)
7878
return multistep.ActionContinue
79-
} else {
80-
// If the Gallery Image Version was not sourced from a Managed Image, that means it was captured directly from a VM, so we just use the gallery ID itself as the source image
81-
s.say(fmt.Sprintf(" -> SourceImageName: '%s'", *image.Id))
82-
s.GeneratedData.Put("SourceImageName", *image.Id)
83-
return multistep.ActionContinue
8479
}
85-
80+
}
81+
// If the Gallery Image Version was not sourced from a Managed Image, that means it was captured directly from a VM, so we just use the gallery ID itself as the source image
82+
if image.Id != nil {
83+
s.say(fmt.Sprintf(" -> SourceImageName: '%s'", *image.Id))
84+
s.GeneratedData.Put("SourceImageName", *image.Id)
85+
return multistep.ActionContinue
8686
}
8787

8888
s.say("Received unexpected response from Azure API, HCP Packer will not be able to track the ancestry of this build.")

0 commit comments

Comments
 (0)