-
Notifications
You must be signed in to change notification settings - Fork 80
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
Deploy template error handling cleanup #296
Conversation
e37ae65
to
4046929
Compare
@@ -299,9 +309,9 @@ func (s *StepDeployTemplate) deleteDeploymentResources(ctx context.Context, depl | |||
resourceName, | |||
resourceGroupName) | |||
if err != nil { | |||
s.say(fmt.Sprintf("Error deleting resource. Will retry.\n"+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We regularly fail to delete attached network resources related to the resource being still attached, this leads to a lot of spam in the output, here I've changed this to only log the error when we fail for real, since almost every build I run fails this check at least once for at least two different resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi there overall this looks good. I made a few comments on the boolean not being immediately clear. Take a look at the alternative suggestions and let me know what you think.
I do suggest inverting the condition in the cleanup step to key if it is a keyVault deployment and return early as opposed to using the if/else statement.
@@ -184,6 +187,24 @@ func TestStepDeployTemplateCleanupShouldVHDOSImageInTemporaryResourceGroup(t *te | |||
} | |||
} | |||
|
|||
func TestStepDeployTemplateCleanupShouldNotDeleteDiskForKeyVaultDeployments(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice test
Not related to your PR but it looks like the Azure plugin needs to have it's partials regenerated
|
750b319
to
6803fea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! 🚢
Currently
step_deploy_template
is used for deploying KeyVaults, and Virtual Machines, however on CleanUp of this step we try and find a VM either way, and then return an "error" if we don't find the VM, this leads to every build falsely showing that we failed to remove the temporary diskThis PR breaks this logic up, and only tries to search for a VM disk when we're actually in a VM deploy
Partially addresses #190