-
Notifications
You must be signed in to change notification settings - Fork 725
CLOUD-1310 adds rds cluster-related resources #48
Conversation
This commit enables aws-nuke to recognise DBClusterParameterGroup and DBCluster type resources and remove them. The changes are necessary to nuke Aurora clusters.
} | ||
|
||
_, err := i.svc.DeleteDBClusterParameterGroup(params) | ||
if err != nil { |
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.
Couldn't you just skip this if
and directly: return err
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.
IMHO the logic is more understandable and separated like this...
first: error handling
then: making the function return what is should
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.
IMO it looks like unnecessary code :>
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.
You could, but then you are implying that whoever looks at the code afterwards understands that err
defaults to nil
. The if statement makes it more explicit and easier to read what's going on. Also, this is how that error is handled across all the classes in aws-nuke where it's applicable, so it is following a common pattern in the program.
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.
Decision?
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.
Your call
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 will leave it in for consistency's sake. If this is a big enough problem then it deserves its own pull request and that if statement should be removed everywhere across the whole application.
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.
Very much agree. Greatly in favor of consistency.
This commit enables aws-nuke to recognise DBClusterParameterGroup and
DBCluster type resources and remove them.
The changes are necessary to nuke Aurora clusters.
@rebuy-de/prp-aws-nuke please review