-
Notifications
You must be signed in to change notification settings - Fork 7
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
WOR-1777 Handle more instances of ManagementExceptions when deleting resources #1777
Conversation
…t exception handling
*/ | ||
public class GetAzureDiskAttachedVmStep implements DeleteControlledResourceStep { | ||
public class GetAzureDiskAttachedVmStep |
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.
I don't have a better suggestion unfortunately, but just calling out that I find it rather confusing that this step is a Get
step that also extends DeleteAzureControlledResourceStep
and it has a deleteResource
method that doesn't delete anything.
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.
I know. Naming things is hard.
There is a fairly extensive explanation in the comments, for this reason.
if (e instanceof LandingZoneNotFoundException) { | ||
// If the landing zone is not present, it's probably because it was removed directly | ||
logger.debug( | ||
"Unable to delete resource {} from workspace {}, because no landing zone was found in LZS", |
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.
Nit: note in the log msg that we are explicitly ignoring the error and moving on.
.findFirst()); | ||
if (code.isPresent()) { | ||
logger.debug( | ||
"LZS encountered management exception {} when deleting resource {} from workspace {}", |
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.
Nit: note in the log msg that we are explicitly ignoring the exception and moving on.
Quality Gate passedIssues Measures |
https://broadworkbench.atlassian.net/browse/WOR-1777
The output of GetAzureDiskAttachedVmStep is only used by
DetachAzureDiskFromVmStep
, which is already set up to handle a missing value.DetachAzureDiskFromVmStep
to extendDeleteAzureControlledResourceStep
resource
, of the appropriate type, and that was trivial to add.LandingZoneNotFoundException
to common error handlingBecause this is changing the parameters of the
FlightMap
, it could cause a running flight to log aNullPointerException
instead of the appropriate exception, if it failed for one of the covered exceptions when runningDeleteFederatedCredentialStep
.