@@ -232,17 +232,6 @@ func (u updateMyCRDV1Beta1Schema) Do(ctx *ratchetingTestContext) error {
232
232
sch .Properties = map [string ]apiextensionsv1.JSONSchemaProps {}
233
233
}
234
234
235
- if ctx .StatusSubresource {
236
- sch = & apiextensionsv1.JSONSchemaProps {
237
- Type : "object" ,
238
- Properties : map [string ]apiextensionsv1.JSONSchemaProps {
239
- "status" : * sch ,
240
- },
241
- }
242
- }
243
-
244
- // sentinel must be in the root level of the schema.
245
- // Do not include this in the status schema.
246
235
uuidString := string (uuid .NewUUID ())
247
236
sentinelName := "__ratcheting_sentinel_field__"
248
237
sch .Properties [sentinelName ] = apiextensionsv1.JSONSchemaProps {
@@ -252,6 +241,15 @@ func (u updateMyCRDV1Beta1Schema) Do(ctx *ratchetingTestContext) error {
252
241
}},
253
242
}
254
243
244
+ if ctx .StatusSubresource {
245
+ sch = & apiextensionsv1.JSONSchemaProps {
246
+ Type : "object" ,
247
+ Properties : map [string ]apiextensionsv1.JSONSchemaProps {
248
+ "status" : * sch ,
249
+ },
250
+ }
251
+ }
252
+
255
253
for _ , v := range myCRD .Spec .Versions {
256
254
if v .Name != myCRDV1Beta1 .Version {
257
255
continue
@@ -278,12 +276,7 @@ func (u updateMyCRDV1Beta1Schema) Do(ctx *ratchetingTestContext) error {
278
276
name : "sentinel-resource" ,
279
277
patch : map [string ]interface {}{
280
278
sentinelName : fmt .Sprintf ("invalid-%d" , counter ),
281
- }}.Do (& ratchetingTestContext {
282
- T : ctx .T ,
283
- DynamicClient : ctx .DynamicClient ,
284
- APIExtensionsClient : ctx .APIExtensionsClient ,
285
- StatusSubresource : false , // Do not carry this over, sentinel check is in the root level.
286
- })
279
+ }}.Do (ctx )
287
280
288
281
if err == nil {
289
282
return false , errors .New ("expected error when creating sentinel resource" )
0 commit comments