-
Notifications
You must be signed in to change notification settings - Fork 3.3k
clean up azure temporary managed os disk #10713
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
Changes from 1 commit
4388695
ab88422
6ef856a
3847c86
d93d0ac
a007898
0e769ca
c385f24
a96d4d4
ac10575
74f6e1f
bae16d9
1b2c36a
bc39c32
2f72108
a2957d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,13 +70,30 @@ func (s *StepDeleteAdditionalDisk) Run(ctx context.Context, state multistep.Stat | |
| var isExistingResourceGroup = state.Get(constants.ArmIsExistingResourceGroup).(bool) | ||
| var resourceGroupName = state.Get(constants.ArmResourceGroupName).(string) | ||
|
|
||
| if dataDisks == nil { | ||
| s.say(fmt.Sprintf(" -> No Additional Disks specified")) | ||
| if isManagedDisk && !isExistingResourceGroup { | ||
| s.say(fmt.Sprintf(" -> Additional Disk : skipping, will ")) | ||
| return multistep.ActionContinue | ||
| } | ||
|
|
||
| if isManagedDisk && !isExistingResourceGroup { | ||
| s.say(fmt.Sprintf(" -> Additional Disk : skipping, managed disk was used...")) | ||
| if isManagedDisk { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think part of this confusion around where we can delete this disk is that I moved the call to While testing this today with a Windows OS build, non-managed, I was getting failures due to Your solution for deleting the OS disk works, but still ends in a failed build because of the double call. I know what I'm pointing out is a different issue than the one you are fixing, but I believe they are related and if we move I moved Here's a gist of the template I am using.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, nice! That takes care of the ordering issue between the cleanup steps very cleanly. I'll incorporate your patch and give it a try on my end 👍 |
||
| s.say("Deleting the temporary managed OS disk ...") | ||
| var vhdUri interface{} | ||
| var ok bool | ||
| if vhdUri, ok = state.GetOk(constants.ArmOSDiskVhd); ok == false { | ||
| msg := "Failed to find VHD URI in state bag!" | ||
| s.say(msg) | ||
| return processStepResult(errors.New(msg), s.error, state) | ||
| } | ||
| vhdUriString := vhdUri.(string) | ||
|
|
||
| if err := s.deleteManaged(ctx, resourceGroupName, vhdUriString); err != nil { | ||
| s.say("Failed to delete the temporary managed OS Disk!") | ||
| return processStepResult(err, s.error, state) | ||
| } | ||
| } | ||
|
|
||
| if dataDisks == nil { | ||
| s.say(fmt.Sprintf(" -> No Additional Disks specified")) | ||
| return multistep.ActionContinue | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.