...
1apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
2name: "[TechPreview] DataGather"
3crd: 0000_10_01_datagather.crd.yaml
4tests:
5 onCreate:
6 - name: Should be able to create a minimal DataGather
7 initial: |
8 apiVersion: insights.openshift.io/v1alpha1
9 kind: DataGather
10 spec: {} # No spec is required for a DataGather
11 expected: |
12 apiVersion: insights.openshift.io/v1alpha1
13 kind: DataGather
14 spec: {}
15 onUpdate:
16 - name: status is present and startTime is added
17 initial: |
18 apiVersion: insights.openshift.io/v1alpha1
19 kind: DataGather
20 spec: {} # No spec is required for a DataGather
21 status:
22 insightsRequestID: xyz
23 updated: |
24 apiVersion: insights.openshift.io/v1alpha1
25 kind: DataGather
26 spec: {} # No spec is required for a DataGather
27 status:
28 insightsRequestID: xyz
29 startTime: 2023-03-13T11:34:06Z
30 expected: |
31 apiVersion: insights.openshift.io/v1alpha1
32 kind: DataGather
33 spec: {} # No spec is required for a DataGather
34 status:
35 insightsRequestID: xyz
36 startTime: 2023-03-13T11:34:06Z
37 - name: startTime cannot be removed from status
38 initial: |
39 apiVersion: insights.openshift.io/v1alpha1
40 kind: DataGather
41 spec: {} # No spec is required for a DataGather
42 status:
43 insightsRequestID: xyz
44 startTime: 2023-03-13T11:34:06Z
45 updated: |
46 apiVersion: insights.openshift.io/v1alpha1
47 kind: DataGather
48 spec: {} # No spec is required for a DataGather
49 status:
50 insightsRequestID: xyz
51 expectedStatusError: "status: Invalid value: \"object\": cannot remove startTime attribute from status"
52 - name: startTime is immutable once set
53 initial: |
54 apiVersion: insights.openshift.io/v1alpha1
55 kind: DataGather
56 spec: {} # No spec is required for a DataGather
57 status:
58 insightsRequestID: xyz
59 startTime: 2023-03-13T11:34:06Z
60 updated: |
61 apiVersion: insights.openshift.io/v1alpha1
62 kind: DataGather
63 spec: {} # No spec is required for a DataGather
64 status:
65 insightsRequestID: xyz
66 startTime: 2023-03-13T12:34:06Z
67 expectedStatusError: "Invalid value: \"string\": startTime is immutable once set"
68 - name: Status is presentt and insightsRequestID is added
69 initial: |
70 apiVersion: insights.openshift.io/v1alpha1
71 kind: DataGather
72 spec: {} # No spec is required for a DataGather
73 status:
74 relatedObjects:
75 - name: periodic-job-xyz
76 resource: "pods"
77 group: ""
78 namespace: "openshift-insights"
79 updated: |
80 apiVersion: insights.openshift.io/v1alpha1
81 kind: DataGather
82 spec: {} # No spec is required for a DataGather
83 status:
84 insightsRequestID: testing-xyz
85 relatedObjects:
86 - name: periodic-job-xyz
87 resource: "pods"
88 group: ""
89 namespace: "openshift-insights"
90 expected: |
91 apiVersion: insights.openshift.io/v1alpha1
92 kind: DataGather
93 spec: {} # No spec is required for a DataGather
94 status:
95 insightsRequestID: testing-xyz
96 relatedObjects:
97 - name: periodic-job-xyz
98 group: ""
99 resource: "pods"
100 namespace: "openshift-insights"
101 - name: insightsRequestID cannot be removed from status
102 initial: |
103 apiVersion: insights.openshift.io/v1alpha1
104 kind: DataGather
105 spec: {} # No spec is required for a DataGather
106 status:
107 insightsRequestID: testing-xyz
108 relatedObjects:
109 - name: periodic-job-xyz
110 group: ""
111 resource: "pods"
112 namespace: "openshift-insights"
113 updated: |
114 apiVersion: insights.openshift.io/v1alpha1
115 kind: DataGather
116 spec: {} # No spec is required for a DataGather
117 status:
118 relatedObjects:
119 - name: periodic-job-xyz
120 group: ""
121 resource: "pods"
122 namespace: "openshift-insights"
123 expectedStatusError: "status: Invalid value: \"object\": cannot remove insightsRequestID attribute from status"
124 - name: insightsRequestID is immutable once set
125 initial: |
126 apiVersion: insights.openshift.io/v1alpha1
127 kind: DataGather
128 spec: {} # No spec is required for a DataGather
129 status:
130 insightsRequestID: testing-xyz
131 relatedObjects:
132 - name: periodic-job-xyz
133 group: ""
134 resource: "pods"
135 namespace: "openshift-insights"
136 updated: |
137 apiVersion: insights.openshift.io/v1alpha1
138 kind: DataGather
139 spec: {} # No spec is required for a DataGather
140 status:
141 insightsRequestID: testing-xyz-updated
142 relatedObjects:
143 - name: periodic-job-xyz
144 group: ""
145 resource: "pods"
146 namespace: "openshift-insights"
147 expectedStatusError: "Invalid value: \"string\": insightsRequestID is immutable once set"
148 - name: finishTime cannot be removed from status
149 initial: |
150 apiVersion: insights.openshift.io/v1alpha1
151 kind: DataGather
152 spec: {} # No spec is required for a DataGather
153 status:
154 finishTime: 2023-03-13T11:34:06Z
155 relatedObjects:
156 - name: periodic-job-xyz
157 group: ""
158 resource: "pods"
159 namespace: "openshift-insights"
160 updated: |
161 apiVersion: insights.openshift.io/v1alpha1
162 kind: DataGather
163 spec: {} # No spec is required for a DataGather
164 status:
165 relatedObjects:
166 - name: periodic-job-xyz
167 group: ""
168 resource: "pods"
169 namespace: "openshift-insights"
170 expectedStatusError: "status: Invalid value: \"object\": cannot remove finishTime attribute from status"
171 - name: dataGatherState cannot be removed from status
172 initial: |
173 apiVersion: insights.openshift.io/v1alpha1
174 kind: DataGather
175 spec: {} # No spec is required for a DataGather
176 status:
177 dataGatherState: Running
178 updated: |
179 apiVersion: insights.openshift.io/v1alpha1
180 kind: DataGather
181 spec: {} # No spec is required for a DataGather
182 status:
183 relatedObjects:
184 - name: periodic-job-xyz
185 group: ""
186 resource: "pods"
187 namespace: "openshift-insights"
188 expectedStatusError: "status: Invalid value: \"object\": cannot remove dataGatherState attribute from status"
189 - name: dataGatherState cannot transition from Running to Pending
190 initial: |
191 apiVersion: insights.openshift.io/v1alpha1
192 kind: DataGather
193 spec: {} # No spec is required for a DataGather
194 status:
195 dataGatherState: Running
196 updated: |
197 apiVersion: insights.openshift.io/v1alpha1
198 kind: DataGather
199 spec: {} # No spec is required for a DataGather
200 status:
201 dataGatherState: Pending
202 expectedStatusError: "status.dataGatherState: Invalid value: \"string\": dataGatherState cannot transition from Running to Pending"
203 - name: dataGatherState cannot transition from Completed to Pending
204 initial: |
205 apiVersion: insights.openshift.io/v1alpha1
206 kind: DataGather
207 spec: {} # No spec is required for a DataGather
208 status:
209 dataGatherState: Completed
210 updated: |
211 apiVersion: insights.openshift.io/v1alpha1
212 kind: DataGather
213 spec: {} # No spec is required for a DataGather
214 status:
215 dataGatherState: Pending
216 expectedStatusError: "status.dataGatherState: Invalid value: \"string\": dataGatherState cannot transition from Completed to Pending"
217 - name: dataGatherState cannot transition from Failed to Pending
218 initial: |
219 apiVersion: insights.openshift.io/v1alpha1
220 kind: DataGather
221 spec: {} # No spec is required for a DataGather
222 status:
223 dataGatherState: Failed
224 updated: |
225 apiVersion: insights.openshift.io/v1alpha1
226 kind: DataGather
227 spec: {} # No spec is required for a DataGather
228 status:
229 dataGatherState: Pending
230 expectedStatusError: "status.dataGatherState: Invalid value: \"string\": dataGatherState cannot transition from Failed to Pending"
231 - name: dataGatherState cannot transition from Completed to Running
232 initial: |
233 apiVersion: insights.openshift.io/v1alpha1
234 kind: DataGather
235 spec: {} # No spec is required for a DataGather
236 status:
237 dataGatherState: Completed
238 updated: |
239 apiVersion: insights.openshift.io/v1alpha1
240 kind: DataGather
241 spec: {} # No spec is required for a DataGather
242 status:
243 dataGatherState: Running
244 expectedStatusError: "status.dataGatherState: Invalid value: \"string\": dataGatherState cannot transition from Completed to Running"
245 - name: dataGatherState cannot transition from Failed to Running
246 initial: |
247 apiVersion: insights.openshift.io/v1alpha1
248 kind: DataGather
249 spec: {} # No spec is required for a DataGather
250 status:
251 dataGatherState: Failed
252 updated: |
253 apiVersion: insights.openshift.io/v1alpha1
254 kind: DataGather
255 spec: {} # No spec is required for a DataGather
256 status:
257 dataGatherState: Running
258 expectedStatusError: "status.dataGatherState: Invalid value: \"string\": dataGatherState cannot transition from Failed to Running"
View as plain text