Commit ed9e054
authored
Issue #, if available: aws-controllers-k8s/community#1146
After a recent update to `/pkg/model/field.go`, shapes _may_ contain **additional** fields/members with a "nested" format such as **DHCPOptions.Fields**: `[DHCPConfigurations TagSpecifications.Tags.Value Tags.Value TagSpecifications DHCPConfigurations.Values TagSpecifications.ResourceType TagSpecifications.Tags Tags.Key DHCPOptionsID OwnerID DHCPConfigurations.Key TagSpecifications.Tags.Key DryRun Tags]` The purpose of that update is to allow users to easily fetch nested shapes and their corresponding configurations using the "nested" field name as the key.
However, `SetResourceForStruct` will never have the opportunity to process and/or fetch shapes and configs for these "nested" fields because the algorithm processes fields **iff they exist in sourceShape**. *Note, sourceShape comes directly from `aws-sdk` in this context, so will NOT have these additional, nested fields.*
This patch iterates over `targetShape.Members` instead of `sourceShape` so these "nested" fields can be included in the lookup logic, but continues to use `sourceShape` index for consistency throughout codebase. There's no change in functionality, but this paves the way for a follow-up PR to check a targetShape's nested Field `SetConfig` if the Field cannot be found in the sourceShape:
```
sourceMemberShapeRef := sourceShape.MemberRefs[targetMemberName]
if sourceMemberShapeRef == nil {
continue
}
// Future patch: check if targetMemberName has SetConfig logic that needs to be processed
```
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent edec6da commit ed9e054
3 files changed
+63
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1226 | 1226 | | |
1227 | 1227 | | |
1228 | 1228 | | |
1229 | | - | |
1230 | | - | |
1231 | | - | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
1232 | 1232 | | |
1233 | 1233 | | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
1239 | 1248 | | |
1240 | 1249 | | |
1241 | 1250 | | |
1242 | 1251 | | |
1243 | | - | |
| 1252 | + | |
1244 | 1253 | | |
1245 | | - | |
| 1254 | + | |
| 1255 | + | |
1246 | 1256 | | |
1247 | 1257 | | |
1248 | 1258 | | |
1249 | 1259 | | |
1250 | | - | |
| 1260 | + | |
1251 | 1261 | | |
1252 | 1262 | | |
1253 | 1263 | | |
1254 | 1264 | | |
1255 | 1265 | | |
1256 | | - | |
1257 | | - | |
| 1266 | + | |
| 1267 | + | |
1258 | 1268 | | |
1259 | 1269 | | |
1260 | 1270 | | |
1261 | | - | |
| 1271 | + | |
1262 | 1272 | | |
1263 | 1273 | | |
1264 | 1274 | | |
1265 | 1275 | | |
1266 | | - | |
1267 | | - | |
| 1276 | + | |
| 1277 | + | |
1268 | 1278 | | |
1269 | 1279 | | |
1270 | 1280 | | |
1271 | 1281 | | |
1272 | 1282 | | |
1273 | 1283 | | |
1274 | 1284 | | |
1275 | | - | |
| 1285 | + | |
1276 | 1286 | | |
1277 | 1287 | | |
1278 | 1288 | | |
| |||
0 commit comments