Skip to content

Conversation

@echen-98
Copy link
Contributor

Description of changes:
Please check if the resulting sdkDelete is as intended.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-bot ack-bot requested a review from jaypipes July 16, 2021 01:35
Comment on lines 1399 to 1403
resp, err = rm.sdkapi.DeleteReplicationGroupWithContext(ctx, input)
rm.metrics.RecordAPICall("DELETE", "DeleteReplicationGroup", err)
// delete call successful
if err == nil {
if foundResource, err := rm.sdkFind(ctx, r); err != ackerr.NotFound {
if isDeleting(foundResource) {
return requeueWaitWhileDeleting
}
return err
}
return r, requeueWaitWhileDeleting
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic does not take values from resp.ReplicationGroup.
Please add a comment here about this behavior in the code.

It is expected to work fine, as the next reconciler run (after requeue wait interval) will fetch latest state of it and lines 1389-1390 above will ensure that the correct status is updated inside reconciler->patchResource.

invoke: Delete
expect: # for the delete case we don't expect a new latest state or a non-nil error
latest_state: nil
expect:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As there is no call to sdkFind() inside sdkDelete(), there is no need to mock DescribeReplicationGroupsWithContext, ListAllowedNodeTypeModifications and ListAllowedNodeTypeModifications service APIs.

@echen-98
Copy link
Contributor Author

@kumargauravsharma addressed both comments

@ack-bot
Copy link
Collaborator

ack-bot commented Jul 16, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: echen-98, kumargauravsharma

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [echen-98,kumargauravsharma]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kumargauravsharma kumargauravsharma merged commit 96bcd46 into aws-controllers-k8s:main Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants