Commit 287334e
authored
handle renamed fields for resource identifiers (#117)
The code that outputs Go code that sets `Spec` or `Status` fields to a
resource identifier field was not accounting for cases where we renamed
the field. Such is the case for many of the RDS controller's resources,
since all the identifier fields for all resources are "de-stuttured" by
renaming, for example, `DBSubnetGroupName` to just `Name` or
`DBClusterParameterGroupName` to just `Name`.
This patch simply ensures we account for renamed fields in the Spec and
Status during calls to `pkg/generate/code.SetResourceIdentifiers` and
adds a unit test to ensure we don't regress in the future.
Issue aws-controllers-k8s/community#852
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.1 parent a73e0a1 commit 287334e
2 files changed
+32
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
922 | 922 | | |
923 | 923 | | |
924 | 924 | | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
925 | 929 | | |
926 | 930 | | |
927 | | - | |
| 931 | + | |
928 | 932 | | |
929 | 933 | | |
930 | 934 | | |
931 | | - | |
932 | | - | |
| 935 | + | |
| 936 | + | |
933 | 937 | | |
934 | 938 | | |
935 | 939 | | |
936 | 940 | | |
937 | 941 | | |
938 | 942 | | |
939 | | - | |
| 943 | + | |
940 | 944 | | |
941 | 945 | | |
942 | 946 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2690 | 2690 | | |
2691 | 2691 | | |
2692 | 2692 | | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
2693 | 2717 | | |
2694 | 2718 | | |
2695 | 2719 | | |
| |||
0 commit comments