You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Invalid set for object list - should warn about listType=set compatibility issues
36
-
// +kubebuilder:listType=set
39
+
// +listType=set
37
40
SetObjectList []TestObject`json:"setObjectList,omitempty"`// want "SetObjectList with listType=set is not recommended due to Server-Side Apply compatibility issues. Consider using listType=atomic or listType=map instead"
38
41
39
42
// Invalid map on primitive list - should error
40
-
// +kubebuilder:listType=map
41
-
// +kubebuilder:listMapKey=name
43
+
// +listType=map
44
+
// +listMapKey=name
42
45
MapPrimitiveList []string`json:"mapPrimitiveList,omitempty"`// want "MapPrimitiveList with listType=map can only be used for object lists, not primitive lists"
43
46
44
47
// Valid map on object list with proper listMapKey - should pass
// Invalid map on object list without listMapKey - should error
50
-
// +kubebuilder:listType=map
53
+
// +listType=map
51
54
MapObjectListNoKey []TestObject`json:"mapObjectListNoKey,omitempty"`// want "MapObjectListNoKey with listType=map must have at least one listMapKey marker"
52
55
53
56
// Invalid map on object list with non-existent listMapKey - should error
54
-
// +kubebuilder:listType=map
55
-
// +kubebuilder:listMapKey=nonexistent
57
+
// +listType=map
58
+
// +listMapKey=nonexistent
56
59
MapObjectListInvalidKey []TestObject`json:"mapObjectListInvalidKey,omitempty"`// want "MapObjectListInvalidKey listMapKey \"nonexistent\" does not exist as a field in the struct"
57
60
58
61
// Valid map with correct JSON tag name - should pass
// Invalid map with non-existent JSON tag name - should error
64
-
// +kubebuilder:listType=map
65
-
// +kubebuilder:listMapKey=invalid_name
67
+
// +listType=map
68
+
// +listMapKey=invalid_name
66
69
MapObjectListInvalidName []SimpleObject`json:"mapObjectListInvalidName,omitempty"`// want "MapObjectListInvalidName listMapKey \"invalid_name\" does not exist as a field in the struct"
67
70
68
71
// Invalid listType value - should error
69
-
// +kubebuilder:listType=invalid
72
+
// +listType=invalid
70
73
InvalidListType []string`json:"invalidListType,omitempty"`// want "InvalidListType has invalid listType \"invalid\", must be one of: atomic, set, map"
71
74
72
75
// Missing listType on primitive array - should warn
@@ -82,17 +85,17 @@ type SSATagsTestSpec struct {
82
85
PointerArrayNoMarker []*TestObject`json:"pointerArrayNoMarker,omitempty"`// want "PointerArrayNoMarker should have a listType marker for proper Server-Side Apply behavior \\(atomic, set, or map\\)"
83
86
84
87
// Defined type tests - defined types should behave as their underlying types
ObjectSetList []Object`json:"objectSetList,omitempty"`// want "ObjectSetList with listType=set is not recommended due to Server-Side Apply compatibility issues. Consider using listType=atomic or listType=map instead"
97
100
98
101
// Missing listType on defined type to basic type - should warn
@@ -102,24 +105,24 @@ type SSATagsTestSpec struct {
102
105
ObjectNoMarker []Object`json:"objectNoMarker,omitempty"`// want "ObjectNoMarker should have a listType marker for proper Server-Side Apply behavior \\(atomic, set, or map\\)"
103
106
104
107
// Pointer to defined type - should behave same as defined type
PointerToObject []*Object`json:"pointerToObject,omitempty"`// want "PointerToObject with listType=set is not recommended due to Server-Side Apply compatibility issues. Consider using listType=atomic or listType=map instead"
110
113
111
114
// Type alias tests - aliases to basic types should behave as primitive lists
ObjectAliasSetList []ObjectAlias`json:"objectAliasSetList,omitempty"`// want "ObjectAliasSetList with listType=set is not recommended due to Server-Side Apply compatibility issues. Consider using listType=atomic or listType=map instead"
124
127
125
128
// Missing listType on alias to basic type - should warn
@@ -129,32 +132,46 @@ type SSATagsTestSpec struct {
129
132
ObjectAliasNoMarker []ObjectAlias`json:"objectAliasNoMarker,omitempty"`// want "ObjectAliasNoMarker should have a listType marker for proper Server-Side Apply behavior \\(atomic, set, or map\\)"
PointerToObjectAlias []*ObjectAlias`json:"pointerToObjectAlias,omitempty"`// want "PointerToObjectAlias with listType=set is not recommended due to Server-Side Apply compatibility issues. Consider using listType=atomic or listType=map instead"
137
140
138
141
// Multiple pointer levels
139
142
PointerToPointerObject []*(*TestObject) `json:"pointerToPointerObject,omitempty"`// want "PointerToPointerObject should have a listType marker for proper Server-Side Apply behavior \\(atomic, set, or map\\)"
140
143
141
144
// Array defined type tests - defined types to array types should behave as array lists
// Missing listType on array defined type - should warn
149
152
StringArrayNoMarkerStringArray`json:"stringArrayNoMarker,omitempty"`// want "StringArrayNoMarker should have a listType marker for proper Server-Side Apply behavior \\(atomic, set, or map\\)"
150
153
151
154
// Array type alias tests - aliases to array types should behave as array lists
StringArrayAliasNoMarkerStringArrayAlias`json:"stringArrayAliasNoMarker,omitempty"`// want "StringArrayAliasNoMarker should have a listType marker for proper Server-Side Apply behavior \\(atomic, set, or map\\)"
163
+
164
+
// Byte array tests - these should be skipped by IsByteArray condition
165
+
// Direct byte array - should be ignored (no listType required)
// Byte array with markers - should be ignored even if markers are present
175
+
// +listType=atomic
176
+
ByteArrayWithMarker []byte`json:"byteArrayWithMarker,omitempty"`// want "ByteArrayWithMarker is a byte array, which does not support the listType marker. Remove the listType marker"
// Invalid set for object list - should warn about listType=set compatibility issues
39
+
// +listType=set
40
+
SetObjectList []TestObject `json:"setObjectList,omitempty"` // want "SetObjectList with listType=set is not recommended due to Server-Side Apply compatibility issues. Consider using listType=atomic or listType=map instead"
41
+
42
+
// Invalid map on primitive list - should error
43
+
// +listType=map
44
+
// +listMapKey=name
45
+
MapPrimitiveList []string `json:"mapPrimitiveList,omitempty"` // want "MapPrimitiveList with listType=map can only be used for object lists, not primitive lists"
46
+
47
+
// Valid map on object list with proper listMapKey - should pass
// Invalid map on object list without listMapKey - should error
53
+
// +listType=map
54
+
MapObjectListNoKey []TestObject `json:"mapObjectListNoKey,omitempty"` // want "MapObjectListNoKey with listType=map must have at least one listMapKey marker"
55
+
56
+
// Invalid map on object list with non-existent listMapKey - should error
57
+
// +listType=map
58
+
// +listMapKey=nonexistent
59
+
MapObjectListInvalidKey []TestObject `json:"mapObjectListInvalidKey,omitempty"` // want "MapObjectListInvalidKey listMapKey \"nonexistent\" does not exist as a field in the struct"
60
+
61
+
// Valid map with correct JSON tag name - should pass
// Invalid map with non-existent JSON tag name - should error
67
+
// +listType=map
68
+
// +listMapKey=invalid_name
69
+
MapObjectListInvalidName []SimpleObject `json:"mapObjectListInvalidName,omitempty"` // want "MapObjectListInvalidName listMapKey \"invalid_name\" does not exist as a field in the struct"
70
+
71
+
// Invalid listType value - should error
72
+
// +listType=invalid
73
+
InvalidListType []string `json:"invalidListType,omitempty"` // want "InvalidListType has invalid listType \"invalid\", must be one of: atomic, set, map"
74
+
75
+
// Missing listType on primitive array - should warn
76
+
PrimitiveArrayNoMarker []string `json:"primitiveArrayNoMarker,omitempty"` // want "PrimitiveArrayNoMarker should have a listType marker for proper Server-Side Apply behavior \\(atomic, set, or map\\)"
77
+
78
+
// Missing listType on object array - should warn
79
+
ObjectArrayNoMarker []TestObject `json:"objectArrayNoMarker,omitempty"` // want "ObjectArrayNoMarker should have a listType marker for proper Server-Side Apply behavior \\(atomic, set, or map\\)"
80
+
81
+
// Non-array field - should be ignored
82
+
SingleValue string `json:"singleValue,omitempty"`
83
+
84
+
// Pointer array field - should behave same as non-pointer
85
+
PointerArrayNoMarker []*TestObject `json:"pointerArrayNoMarker,omitempty"` // want "PointerArrayNoMarker should have a listType marker for proper Server-Side Apply behavior \\(atomic, set, or map\\)"
86
+
87
+
// Defined type tests - defined types should behave as their underlying types
ObjectSetList []Object `json:"objectSetList,omitempty"` // want "ObjectSetList with listType=set is not recommended due to Server-Side Apply compatibility issues. Consider using listType=atomic or listType=map instead"
100
+
101
+
// Missing listType on defined type to basic type - should warn
102
+
StringNoMarker []String `json:"stringNoMarker,omitempty"` // want "StringNoMarker should have a listType marker for proper Server-Side Apply behavior \\(atomic, set, or map\\)"
103
+
104
+
// Missing listType on defined type to object - should warn
105
+
ObjectNoMarker []Object `json:"objectNoMarker,omitempty"` // want "ObjectNoMarker should have a listType marker for proper Server-Side Apply behavior \\(atomic, set, or map\\)"
106
+
107
+
// Pointer to defined type - should behave same as defined type
PointerToObject []*Object `json:"pointerToObject,omitempty"` // want "PointerToObject with listType=set is not recommended due to Server-Side Apply compatibility issues. Consider using listType=atomic or listType=map instead"
113
+
114
+
// Type alias tests - aliases to basic types should behave as primitive lists
ObjectAliasSetList []ObjectAlias `json:"objectAliasSetList,omitempty"` // want "ObjectAliasSetList with listType=set is not recommended due to Server-Side Apply compatibility issues. Consider using listType=atomic or listType=map instead"
127
+
128
+
// Missing listType on alias to basic type - should warn
129
+
StringAliasNoMarker []StringAlias `json:"stringAliasNoMarker,omitempty"` // want "StringAliasNoMarker should have a listType marker for proper Server-Side Apply behavior \\(atomic, set, or map\\)"
130
+
131
+
// Missing listType on alias to object - should warn
132
+
ObjectAliasNoMarker []ObjectAlias `json:"objectAliasNoMarker,omitempty"` // want "ObjectAliasNoMarker should have a listType marker for proper Server-Side Apply behavior \\(atomic, set, or map\\)"
PointerToObjectAlias []*ObjectAlias `json:"pointerToObjectAlias,omitempty"` // want "PointerToObjectAlias with listType=set is not recommended due to Server-Side Apply compatibility issues. Consider using listType=atomic or listType=map instead"
140
+
141
+
// Multiple pointer levels
142
+
PointerToPointerObject []*(*TestObject) `json:"pointerToPointerObject,omitempty"` // want "PointerToPointerObject should have a listType marker for proper Server-Side Apply behavior \\(atomic, set, or map\\)"
143
+
144
+
// Array defined type tests - defined types to array types should behave as array lists
// Missing listType on array defined type - should warn
152
+
StringArrayNoMarker StringArray `json:"stringArrayNoMarker,omitempty"` // want "StringArrayNoMarker should have a listType marker for proper Server-Side Apply behavior \\(atomic, set, or map\\)"
153
+
154
+
// Array type alias tests - aliases to array types should behave as array lists
StringArrayAliasNoMarker StringArrayAlias `json:"stringArrayAliasNoMarker,omitempty"` // want "StringArrayAliasNoMarker should have a listType marker for proper Server-Side Apply behavior \\(atomic, set, or map\\)"
163
+
164
+
// Byte array tests - these should be skipped by IsByteArray condition
165
+
// Direct byte array - should be ignored (no listType required)
// Byte array with markers - should be ignored even if markers are present
175
+
ByteArrayWithMarker []byte `json:"byteArrayWithMarker,omitempty"` // want "ByteArrayWithMarker is a byte array, which does not support the listType marker. Remove the listType marker"
0 commit comments