@@ -160,7 +160,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
160
160
},
161
161
},
162
162
},
163
- testingutil .GetDockerImageTestComponent (divRRTrue , nil ),
163
+ testingutil .GetDockerImageTestComponent (divRRTrue , nil , nil ),
164
164
},
165
165
Events : & v1.Events {
166
166
DevWorkspaceEvents : v1.DevWorkspaceEvents {
@@ -498,7 +498,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
498
498
},
499
499
},
500
500
},
501
- testingutil .GetDockerImageTestComponent (divRRFalse , parentOverridesFromMainDevfile ),
501
+ testingutil .GetDockerImageTestComponent (divRRFalse , nil , parentOverridesFromMainDevfile ),
502
502
{
503
503
Name : "runtime" ,
504
504
ComponentUnion : v1.ComponentUnion {
@@ -736,7 +736,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
736
736
},
737
737
},
738
738
//no overrides so expected values are the same as the parent
739
- testingutil .GetDockerImageTestComponent (divRRTrue , importFromUri1 ),
739
+ testingutil .GetDockerImageTestComponent (divRRTrue , nil , importFromUri1 ),
740
740
{
741
741
Name : "runtime" ,
742
742
ComponentUnion : v1.ComponentUnion {
@@ -1462,7 +1462,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
1462
1462
},
1463
1463
},
1464
1464
},
1465
- testingutil .GetDockerImageTestComponent (divRRFalse , nil ),
1465
+ testingutil .GetDockerImageTestComponent (divRRFalse , nil , nil ),
1466
1466
},
1467
1467
Events : & v1.Events {
1468
1468
DevWorkspaceEvents : v1.DevWorkspaceEvents {
@@ -1600,7 +1600,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
1600
1600
},
1601
1601
},
1602
1602
},
1603
- testingutil .GetDockerImageTestComponent (divRRTrue , pluginOverridesFromMainDevfile ),
1603
+ testingutil .GetDockerImageTestComponent (divRRTrue , nil , pluginOverridesFromMainDevfile ),
1604
1604
{
1605
1605
Name : "runtime" ,
1606
1606
ComponentUnion : v1.ComponentUnion {
@@ -3107,7 +3107,7 @@ func Test_parseParentFromRegistry(t *testing.T) {
3107
3107
},
3108
3108
},
3109
3109
},
3110
- testingutil .GetDockerImageTestComponent (defaultDiv , nil ),
3110
+ testingutil .GetDockerImageTestComponent (defaultDiv , nil , nil ),
3111
3111
},
3112
3112
},
3113
3113
},
@@ -3249,7 +3249,7 @@ func Test_parseParentFromRegistry(t *testing.T) {
3249
3249
},
3250
3250
},
3251
3251
},
3252
- testingutil .GetDockerImageTestComponent (div , parentOverridesFromMainDevfile ),
3252
+ testingutil .GetDockerImageTestComponent (div , nil , parentOverridesFromMainDevfile ),
3253
3253
{
3254
3254
Name : "runtime2" ,
3255
3255
ComponentUnion : v1.ComponentUnion {
@@ -3389,7 +3389,7 @@ func Test_parseParentFromRegistry(t *testing.T) {
3389
3389
},
3390
3390
},
3391
3391
},
3392
- testingutil .GetDockerImageTestComponent (defaultDiv , importFromRegistry ),
3392
+ testingutil .GetDockerImageTestComponent (defaultDiv , nil , importFromRegistry ),
3393
3393
{
3394
3394
Name : "runtime2" ,
3395
3395
ComponentUnion : v1.ComponentUnion {
@@ -3503,7 +3503,7 @@ func Test_parseParentFromKubeCRD(t *testing.T) {
3503
3503
},
3504
3504
},
3505
3505
},
3506
- testingutil .GetDockerImageTestComponent (defaultDiv , nil ),
3506
+ testingutil .GetDockerImageTestComponent (defaultDiv , nil , nil ),
3507
3507
},
3508
3508
},
3509
3509
}
@@ -3522,7 +3522,7 @@ func Test_parseParentFromKubeCRD(t *testing.T) {
3522
3522
},
3523
3523
},
3524
3524
},
3525
- testingutil .GetDockerImageTestComponent (defaultDiv , nil ),
3525
+ testingutil .GetDockerImageTestComponent (defaultDiv , nil , nil ),
3526
3526
},
3527
3527
},
3528
3528
}
@@ -3626,7 +3626,7 @@ func Test_parseParentFromKubeCRD(t *testing.T) {
3626
3626
},
3627
3627
},
3628
3628
},
3629
- testingutil .GetDockerImageTestComponent (div , parentOverridesFromMainDevfile ),
3629
+ testingutil .GetDockerImageTestComponent (div , nil , parentOverridesFromMainDevfile ),
3630
3630
{
3631
3631
Name : "runtime" ,
3632
3632
ComponentUnion : v1.ComponentUnion {
@@ -3719,7 +3719,7 @@ func Test_parseParentFromKubeCRD(t *testing.T) {
3719
3719
},
3720
3720
},
3721
3721
},
3722
- testingutil .GetDockerImageTestComponent (defaultDiv , importFromKubeCRD ),
3722
+ testingutil .GetDockerImageTestComponent (defaultDiv , nil , importFromKubeCRD ),
3723
3723
{
3724
3724
Name : "runtime" ,
3725
3725
ComponentUnion : v1.ComponentUnion {
@@ -4490,7 +4490,7 @@ func getUnsetBooleanDevfileTestData(apiVersion string) (devfileData data.Devfile
4490
4490
}
4491
4491
4492
4492
if apiVersion != string (data .APISchemaVersion200 ) && apiVersion != string (data .APISchemaVersion210 ) {
4493
- comp := []v1.Component {testingutil .GetDockerImageTestComponent (testingutil.DockerImageValues {}, nil )}
4493
+ comp := []v1.Component {testingutil .GetDockerImageTestComponent (testingutil.DockerImageValues {}, nil , nil )}
4494
4494
err = devfileData .AddComponents (comp )
4495
4495
}
4496
4496
@@ -4510,12 +4510,14 @@ func getBooleanDevfileTestData(apiVersion string, setDefault bool) (devfileData
4510
4510
isDefault * bool
4511
4511
rootRequired * bool
4512
4512
ephemeral * bool
4513
+ autoBuild * bool
4514
+ deployByDefaul * bool
4513
4515
}
4514
4516
4515
4517
//default values according to spec
4516
- defaultBools := boolValues {& isFalse , & isFalse , & isFalse , & isFalse , & isTrue , & isFalse , & isFalse , & isFalse }
4518
+ defaultBools := boolValues {& isFalse , & isFalse , & isFalse , & isFalse , & isTrue , & isFalse , & isFalse , & isFalse , & isFalse , & isFalse }
4517
4519
//set values will be a mix of default and inverse values
4518
- setBools := boolValues {& isTrue , & isTrue , & isFalse , & isTrue , & isFalse , & isFalse , & isTrue , & isFalse }
4520
+ setBools := boolValues {& isTrue , & isTrue , & isFalse , & isTrue , & isFalse , & isFalse , & isTrue , & isFalse , & isTrue , & isFalse }
4519
4521
4520
4522
var values boolValues
4521
4523
@@ -4644,8 +4646,14 @@ func getBooleanDevfileTestData(apiVersion string, setDefault bool) (devfileData
4644
4646
}
4645
4647
4646
4648
if apiVersion != string (data .APISchemaVersion200 ) && apiVersion != string (data .APISchemaVersion210 ) {
4647
- comp := []v1.Component {testingutil .GetDockerImageTestComponent (testingutil.DockerImageValues {RootRequired : values .rootRequired }, nil )}
4649
+ comp := []v1.Component {testingutil .GetDockerImageTestComponent (testingutil.DockerImageValues {RootRequired : values .rootRequired }, values . autoBuild , nil )}
4648
4650
err = devfileData .AddComponents (comp )
4651
+
4652
+ openshiftComponent , _ := devfileData .GetComponents (common.DevfileOptions {ComponentOptions : common.ComponentOptions {
4653
+ ComponentType : v1 .OpenshiftComponentType ,
4654
+ }})
4655
+ openshiftComponent [0 ].Openshift .DeployByDefault = values .deployByDefaul
4656
+
4649
4657
}
4650
4658
4651
4659
return devfileData , err
0 commit comments