Commit 77778f3
authored
Extend GoTag configuration to nested fields and attributes (#487)
Building upon the introduced `GoTag` configuration in 3753ca3, this
commit expands the functionality to cover nested fields and attributes.
Now users will be able to set custom Go Tags for nested fields using
JSONPath style directives. e.g:
```yaml
resources:
AccessEntries:
fields:
AccessPolicies.AccessScope.Type:
go_tag: json:"type,omitempty"
```
This patch also refactors `updateTypeDefAttributeWithReference` function
to reuse the code for finding and mutating Attribute objects.
Tested with eks-controller (`AccessPolicies.AccessScope.Type`).
Signed-off-by: Amine Hilaly <hilalyamine@gmail.com>
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.1 parent 610c476 commit 77778f3
3 files changed
+51
-10
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 | | |
| |||
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
505 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
506 | 509 | | |
507 | 510 | | |
508 | 511 | | |
509 | 512 | | |
510 | 513 | | |
511 | | - | |
512 | | - | |
513 | | - | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
514 | 526 | | |
515 | 527 | | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
520 | 531 | | |
521 | 532 | | |
522 | 533 | | |
| |||
587 | 598 | | |
588 | 599 | | |
589 | 600 | | |
| 601 | + | |
| 602 | + | |
590 | 603 | | |
591 | | - | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
592 | 620 | | |
593 | 621 | | |
594 | 622 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
0 commit comments