Commit 8faf2c8
authored
Remove type aliases for controller-tools validation (#493)
Replace custom type aliases with direct slice types to leverage
controller-tools' array items validation feature. This eliminates
the need for type conversion functions and resolves pointer copying
limitations.
Previously:
// +kubebuilder:validation:MaxLength=255
// +kubebuilder:validation:Pattern=^[a-zA-Z0-9\-_]+$
type PtpInterfaceItem string
type PtpInterfaceItemList []PtpInterfaceItem
Now:
// +kubebuilder:validation:items:MaxLength=255
// +kubebuilder:validation:items:Pattern=^[a-zA-Z0-9\-_]+$
// +nullable
type PtpInterfaceItemList []string
This change removes unnecessary conversion functions and avoids
controller-tools limitations with array pointer copying.
The +nullable maintains existing behavior where nil preserves current
system configuration, which was previously handled through pointer
semantics.
This change also upgrades controllers-tools to v0.15.0 to allow
:items: validations.
Test Plan:
- PASS: build crd and ensure it has the same schema as before, validations
- PASS: deploy SX subcloud with:
- ptp instances & interfaces
- service parameters
- dns & ntp servers
- storage configured
- PASS: perform day-2 operations on system & host
Signed-off-by: Wallysson Silva <wallysson.silva@windriver.com>1 parent 49e0274 commit 8faf2c8
File tree
38 files changed
+931
-909
lines changed- api/v1
- build
- config/crd/bases
- controllers
- common
- host
- system
- docs/charts
- hack
- helm/wind-river-cloud-platform-deployment-manager/templates
38 files changed
+931
-909
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | 79 | | |
96 | 80 | | |
97 | 81 | | |
| |||
171 | 155 | | |
172 | 156 | | |
173 | 157 | | |
174 | | - | |
| 158 | + | |
175 | 159 | | |
176 | 160 | | |
177 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
| 351 | + | |
| 352 | + | |
359 | 353 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
| 354 | + | |
364 | 355 | | |
365 | 356 | | |
366 | 357 | | |
| |||
560 | 551 | | |
561 | 552 | | |
562 | 553 | | |
563 | | - | |
564 | | - | |
| 554 | + | |
565 | 555 | | |
566 | 556 | | |
567 | 557 | | |
| |||
611 | 601 | | |
612 | 602 | | |
613 | 603 | | |
614 | | - | |
615 | | - | |
| 604 | + | |
616 | 605 | | |
617 | 606 | | |
618 | 607 | | |
| |||
648 | 637 | | |
649 | 638 | | |
650 | 639 | | |
651 | | - | |
652 | | - | |
| 640 | + | |
653 | 641 | | |
654 | 642 | | |
655 | 643 | | |
| |||
843 | 831 | | |
844 | 832 | | |
845 | 833 | | |
846 | | - | |
847 | | - | |
848 | | - | |
| 834 | + | |
849 | 835 | | |
850 | 836 | | |
851 | 837 | | |
| |||
965 | 951 | | |
966 | 952 | | |
967 | 953 | | |
968 | | - | |
969 | | - | |
| 954 | + | |
970 | 955 | | |
971 | 956 | | |
972 | 957 | | |
| |||
975 | 960 | | |
976 | 961 | | |
977 | 962 | | |
978 | | - | |
979 | | - | |
| 963 | + | |
980 | 964 | | |
981 | 965 | | |
982 | 966 | | |
| |||
989 | 973 | | |
990 | 974 | | |
991 | 975 | | |
992 | | - | |
993 | | - | |
994 | | - | |
995 | | - | |
| 976 | + | |
996 | 977 | | |
997 | 978 | | |
998 | 979 | | |
| |||
1012 | 993 | | |
1013 | 994 | | |
1014 | 995 | | |
1015 | | - | |
1016 | | - | |
| 996 | + | |
1017 | 997 | | |
1018 | 998 | | |
1019 | 999 | | |
| |||
1036 | 1016 | | |
1037 | 1017 | | |
1038 | 1018 | | |
1039 | | - | |
1040 | | - | |
| 1019 | + | |
1041 | 1020 | | |
1042 | 1021 | | |
1043 | 1022 | | |
| |||
1103 | 1082 | | |
1104 | 1083 | | |
1105 | 1084 | | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
| 1085 | + | |
| 1086 | + | |
1109 | 1087 | | |
1110 | | - | |
1111 | | - | |
| 1088 | + | |
1112 | 1089 | | |
1113 | 1090 | | |
1114 | 1091 | | |
1115 | 1092 | | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
| 1093 | + | |
| 1094 | + | |
1119 | 1095 | | |
1120 | | - | |
1121 | | - | |
| 1096 | + | |
1122 | 1097 | | |
1123 | 1098 | | |
1124 | 1099 | | |
| |||
0 commit comments