-
Notifications
You must be signed in to change notification settings - Fork 226
return nil if observed is nil from a successful delete #182
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
Conversation
/lgtm |
[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 |
if ackcompare.IsNil(r) { | ||
return nil, 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.
Shouldn't this work just with a simple nil comparison? if r != nil { ... }
/cc @vijtrip2 @surajkota
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.
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.
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.
isNil method handles this case as well
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.
@surajkota no, the ackcompare.IsNil
should not be used here.
@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:
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. |
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.
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, returnnil, 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.