Commit 9f6ca92
authored
Allow OperatorType to be a list such that one API can map to multiple operations (#166)
Allow OperatorType to be a list such that one API can map to multiple operations.
This is required in certain cases where the same API call maps to both Create and Update operations such as `RegisterScalableTarget` and `PutScalingPolicy`
[Link to ApplicationAutoscaling PR with the related change](aws-controllers-k8s/applicationautoscaling-controller#27)
Note: This change will require all other services to update their generator configs as well.
Issue #, if available:
aws-controllers-k8s/community#867
### Description of changes:
The `getOpTypeAndResourceName` method handles each of the following cases same as before in addition to the new case 5-
1. the cfg itself is nil
2. cfg is not nil but opId is not in the cfg
3. cfg is not nil, the opID is in the cfg but the opType is not specified
```
operations:
DescribeScalableTargets:
primary_identifier_field_name: ResourceID
```
4. One API -> one operations
```
operations:
PutScalingPolicy:
operation_type:
- Create
```
5. One API -> multiple operations
```
operations:
PutScalingPolicy:
operation_type:
- Create
- Update
```
### Testing
- I tested by generating the controller code for both applicationAutoscaling and the SageMaker repos.
- The unit tests pass as is.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.1 parent ea9b76d commit 9f6ca92
2 files changed
+47
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | | - | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
| |||
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
40 | | - | |
| 46 | + | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
| |||
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
209 | | - | |
210 | | - | |
211 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
212 | 216 | | |
213 | | - | |
214 | 217 | | |
215 | 218 | | |
216 | 219 | | |
| |||
382 | 385 | | |
383 | 386 | | |
384 | 387 | | |
385 | | - | |
| 388 | + | |
386 | 389 | | |
| 390 | + | |
387 | 391 | | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
393 | 399 | | |
394 | | - | |
395 | | - | |
396 | | - | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
397 | 403 | | |
398 | 404 | | |
399 | | - | |
400 | | - | |
| 405 | + | |
401 | 406 | | |
0 commit comments