Skip to content

Conversation

surajkota
Copy link
Member

Issue #, if available:
aws-controllers-k8s/community#931

Description of changes:
Solution 2 in the issue linked above. If rm.Delete does not return an error, and observed is also nil, return nil, nil to the caller instead of the resource passed to the method.

Testing:
make test
Manually using sagemaker controller

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 review from a-hilaly and jaypipes September 7, 2021 01:43
@vijtrip2
Copy link
Contributor

vijtrip2 commented Sep 7, 2021

/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Sep 7, 2021
@ack-bot
Copy link
Collaborator

ack-bot commented Sep 7, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: A-Hilaly, surajkota, vijtrip2

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:

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

@ack-bot ack-bot merged commit 0916df1 into aws-controllers-k8s:main Sep 7, 2021
Comment on lines +266 to +268
if ackcompare.IsNil(r) {
return nil, err
}
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this work just with a simple nil comparison? if r != nil { ... }
/cc @vijtrip2 @surajkota

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, @a-hilaly is correct. We do not need the ackcompare.IsNil here. r is a *resource, which is a pointer type, not an interface.

Copy link
Member Author

Choose a reason for hiding this comment

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

isNil method handles this case as well

Copy link
Collaborator

Choose a reason for hiding this comment

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

@surajkota no, the ackcompare.IsNil should not be used here.

@ack-bot ack-bot requested a review from vijtrip2 September 8, 2021 09:26
@ack-bot
Copy link
Collaborator

ack-bot commented Sep 8, 2021

@a-hilaly: GitHub didn't allow me to request PR reviews from the following users: surajkota.

Note that only aws-controllers-k8s members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

Shouldn't this work just with a simple nil comparison? if r != nil { ... }
/cc @vijtrip2 @surajkota

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@surajkota surajkota mentioned this pull request Sep 10, 2021
ack-bot pushed a commit that referenced this pull request Sep 10, 2021
Issue #, if available:
Addresses #182 (comment)

Testing:
mode e2e test using sagemaker controller

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants