-
Notifications
You must be signed in to change notification settings - Fork 190
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
Handle nil fields in response from describe API output - readOne and readMany #34
Conversation
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.
See inline for a requested change. Also, you will need to modify the unit tests in pkg/generate
4332bce
to
e135540
Compare
@jaypipes Thanks for the quick review, PR is now ready to merge. Please check notes to the reviewer in the description |
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 looks good to me. I'd like @vijtrip2 to review this first, though, and just have an extra set of eyes on this part of the generated codebase. Vijay, please double-check that by setting Spac and Status fields to nil
for empty fields in a Output shape, we would not be overriding any important or defaulted values...
Looks good to me.
|
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.
LGTM!
Great! thanks folks |
Description of changes:
Currently, we create a copy for the current resource state in sdkFind and merge the output of describe output if it is non-nil. This doesn't work for fields that can toggle between nil and non-nil. The latest resource should match the output from AWS service. This PR addresses this issue
Testing
with sagemaker controller aws-controllers-k8s/sagemaker-controller#7
Notes to the reviewer
Change is not implemented for the
ko.Status.ACKResourceMetadata
field because the only case I see where it can toggle is if the user changes the name of resource they created, in which casesdkFind
will throw anackerr.NotFound
error and sdkCreate should overwrite the ARN.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.