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
add support for 2.2.1 and 2.2.2 schema versions (#208)
* add support for 2.2.1 and 2.2.2 schema versions
Signed-off-by: Jordan Dubrick <[email protected]>
* update error output msg
Signed-off-by: Jordan Dubrick <[email protected]>
---------
Signed-off-by: Jordan Dubrick <[email protected]>
unsupportedSchemaError:=`error parsing devfile because of non-compliant data due to unable to find schema for version "2.2.5". The parser supports devfile schema for version 2.0.0, 2.1.0, 2.2.0, 2.2.1, 2.2.2, v1alpha2`
271
+
265
272
typeargsstruct {
266
273
args parser.ParserArgs
267
274
}
@@ -274,6 +281,7 @@ spec:
274
281
wantOpenshiftInlinestring
275
282
wantVariablesmap[string]string
276
283
additionalChecksfunc(parser.DevfileObj) error
284
+
wantErrorStr*string
277
285
}{
278
286
{
279
287
name: "with external overriding variables",
@@ -297,6 +305,7 @@ spec:
297
305
Projects: map[string][]string{},
298
306
StarterProjects: map[string][]string{},
299
307
},
308
+
wantErrorStr: nil,
300
309
},
301
310
{
302
311
name: "with new external variables",
@@ -321,6 +330,7 @@ spec:
321
330
Projects: map[string][]string{},
322
331
StarterProjects: map[string][]string{},
323
332
},
333
+
wantErrorStr: nil,
324
334
}, {
325
335
name: "with new external variables",
326
336
args: args{
@@ -343,6 +353,7 @@ spec:
343
353
Projects: map[string][]string{},
344
354
StarterProjects: map[string][]string{},
345
355
},
356
+
wantErrorStr: nil,
346
357
}, {
347
358
name: "with external variables and covertUriToInline is false",
348
359
args: args{
@@ -364,6 +375,7 @@ spec:
364
375
Projects: map[string][]string{},
365
376
StarterProjects: map[string][]string{},
366
377
},
378
+
wantErrorStr: nil,
367
379
},
368
380
{
369
381
name: "with flattening set to false and setBooleanDefaults to true",
@@ -386,6 +398,7 @@ spec:
386
398
Projects: map[string][]string{},
387
399
StarterProjects: map[string][]string{},
388
400
},
401
+
wantErrorStr: nil,
389
402
},
390
403
{
391
404
name: "with setBooleanDefaults to false",
@@ -408,6 +421,7 @@ spec:
408
421
Projects: map[string][]string{},
409
422
StarterProjects: map[string][]string{},
410
423
},
424
+
wantErrorStr: nil,
411
425
},
412
426
{
413
427
name: "get content from path",
@@ -429,6 +443,7 @@ spec:
429
443
Projects: map[string][]string{},
430
444
StarterProjects: map[string][]string{},
431
445
},
446
+
wantErrorStr: nil,
432
447
},
433
448
{
434
449
name: "get content from url",
@@ -450,6 +465,7 @@ spec:
450
465
Projects: map[string][]string{},
451
466
StarterProjects: map[string][]string{},
452
467
},
468
+
wantErrorStr: nil,
453
469
},
454
470
{
455
471
name: "with parent and registry url in devfile",
@@ -471,6 +487,7 @@ spec:
471
487
Projects: map[string][]string{},
472
488
StarterProjects: map[string][]string{},
473
489
},
490
+
wantErrorStr: nil,
474
491
},
475
492
{
476
493
name: "with parent and no registry url in devfile",
@@ -495,6 +512,7 @@ spec:
495
512
Projects: map[string][]string{},
496
513
StarterProjects: map[string][]string{},
497
514
},
515
+
wantErrorStr: nil,
498
516
},
499
517
{
500
518
name: "getting from cluster and setting default namespace",
@@ -527,6 +545,7 @@ spec:
527
545
Projects: map[string][]string{},
528
546
StarterProjects: map[string][]string{},
529
547
},
548
+
wantErrorStr: nil,
530
549
},
531
550
{
532
551
name: "parsing devfile with context path containing multiple devfiles => priority to devfile.yaml",
@@ -555,6 +574,7 @@ spec:
555
574
}
556
575
returnnil
557
576
},
577
+
wantErrorStr: nil,
558
578
},
559
579
{
560
580
name: "parsing devfile with context path containing multiple devfiles => priority to .devfile.yaml",
@@ -583,6 +603,7 @@ spec:
583
603
}
584
604
returnnil
585
605
},
606
+
wantErrorStr: nil,
586
607
},
587
608
{
588
609
name: "parsing devfile with context path containing multiple devfiles => priority to devfile.yml",
@@ -611,6 +632,7 @@ spec:
611
632
}
612
633
returnnil
613
634
},
635
+
wantErrorStr: nil,
614
636
},
615
637
{
616
638
name: "parsing devfile with context path containing multiple devfiles => priority to .devfile.yml",
@@ -639,6 +661,7 @@ spec:
639
661
}
640
662
returnnil
641
663
},
664
+
wantErrorStr: nil,
642
665
},
643
666
{
644
667
name: "parsing devfile with .yml extension",
@@ -667,6 +690,7 @@ spec:
667
690
}
668
691
returnnil
669
692
},
693
+
wantErrorStr: nil,
670
694
},
671
695
{
672
696
name: "parsing .devfile with .yml extension",
@@ -695,6 +719,7 @@ spec:
695
719
}
696
720
returnnil
697
721
},
722
+
wantErrorStr: nil,
698
723
},
699
724
{
700
725
name: "parsing .devfile with .yaml extension",
@@ -723,6 +748,7 @@ spec:
723
748
}
724
749
returnnil
725
750
},
751
+
wantErrorStr: nil,
726
752
},
727
753
{
728
754
name: "parsing any valid devfile regardless of extension",
return"", fmt.Errorf("unable to find schema for version %q. The parser supports devfile schema for version %s", version, strings.Join(supportedVersions, ", "))
55
57
}
56
58
klog.V(4).Infof("devfile apiVersion '%s' is supported", version)
"description": "Devfile describes the structure of a cloud-native devworkspace and development environment.",
21
21
"type": "object",
22
-
"title": "Devfile schema - Version 2.2.1-alpha",
22
+
"title": "Devfile schema - Version 2.2.0",
23
23
"required": [
24
24
"schemaVersion"
25
25
],
@@ -212,7 +212,7 @@ const JsonSchema220 = `{
212
212
"additionalProperties": false
213
213
},
214
214
"hotReloadCapable": {
215
-
"description": "Specify whether the command is restarted or not when the source code changes. If set to 'true' the command won't be restarted. A *hotReloadCapable* 'run' or 'debug' command is expected to handle file changes on its own and won't be restarted. A *hotReloadCapable* 'build' command is expected to be executed only once and won't be executed again. This field is taken into account only for commands 'build', 'run' and 'debug' with 'isDefault' set to 'true'.\n\nDefault value is 'false'",
215
+
"description": "Whether the command is capable to reload itself when source code changes. If set to 'true' the command won't be restarted and it is expected to handle file changes on its own.\n\nDefault value is 'false'",
216
216
"type": "boolean"
217
217
},
218
218
"label": {
@@ -1104,7 +1104,7 @@ const JsonSchema220 = `{
1104
1104
"additionalProperties": false
1105
1105
},
1106
1106
"hotReloadCapable": {
1107
-
"description": "Specify whether the command is restarted or not when the source code changes. If set to 'true' the command won't be restarted. A *hotReloadCapable* 'run' or 'debug' command is expected to handle file changes on its own and won't be restarted. A *hotReloadCapable* 'build' command is expected to be executed only once and won't be executed again. This field is taken into account only for commands 'build', 'run' and 'debug' with 'isDefault' set to 'true'.\n\nDefault value is 'false'",
1107
+
"description": "Whether the command is capable to reload itself when source code changes. If set to 'true' the command won't be restarted and it is expected to handle file changes on its own.\n\nDefault value is 'false'",
0 commit comments