-
Notifications
You must be signed in to change notification settings - Fork 207
Use SetConfig
in SetResourceForStruct
when target shape has no members
#292
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
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.
Correct that one hard-coded OpTypeList thing and I'm good with this, thank you @brycahta!
// Use setResourceForScalar and dereference sourceAdaptedVarName | ||
// because primitives are being set. | ||
sourceAdaptedVarName = "*" + sourceAdaptedVarName |
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.
This is fine for now, but I recommend we clean up the setResourceForScalar()
method implementation to be able to properly handle this only using the sourceShapeRef information.
logs from failing
|
/test s3-olm-test |
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.
👍
fields: | ||
DHCPConfigurations.Values: | ||
set: | ||
- from: AttributeValue.Value |
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 might consider adding:
method: CREATE
here in order to exercise the OpType passing down into the recursive SetResourceForXXX functions.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brycahta, jaypipes 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 |
Issue #, if available: aws-controllers-k8s/community#1146
This is a follow-up to #289. A
targetShape
without members inSetResourceForStruct
will not be processed today; however, this is not desired behavior for all APIs such as EC2's DHCPOptions resource.This patch will look up and consume
SetConfig
inSetResourceForStruct
whentargetShape
has no members like when DHCPOptions' field,DHCPConfigurations.Values []*string
, aligns (by name) with aws-sdk's output shape,DhcpConfigurations.Values []*AttributeValue
. Instead of skipping the processing ofValues []*string
field, it will check if aSetConfig
exists and if it's valid (referencing a real shape in sourceShape), then use that updated field to source the target field's value resulting in usingDhcpConfigurations.Values.Value *string
to populate the resource'sDHCPConfigurations.Values []*string
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.