@@ -33,17 +33,24 @@ import (
33
33
)
34
34
35
35
func TestContainerBuildReconciler (t * testing.T ) {
36
- dwSA := & corev1.ServiceAccount {
36
+ dwPod := & corev1.Pod {
37
37
TypeMeta : metav1.TypeMeta {
38
- Kind : "ServiceAccount " ,
38
+ Kind : "Pod " ,
39
39
APIVersion : "v1" ,
40
40
},
41
41
ObjectMeta : metav1.ObjectMeta {
42
- Name : constants . DevWorkspaceServiceAccountName ,
42
+ Name : "devworkspace-controller" ,
43
43
Namespace : "eclipse-che" ,
44
+ Labels : map [string ]string {
45
+ constants .KubernetesNameLabelKey : constants .DevWorkspaceControllerName ,
46
+ constants .KubernetesPartOfLabelKey : constants .DevWorkspaceOperatorName ,
47
+ },
48
+ },
49
+ Spec : corev1.PodSpec {
50
+ ServiceAccountName : constants .DevWorkspaceServiceAccountName ,
44
51
},
45
52
}
46
- ctx := test .GetDeployContext (nil , []runtime.Object {dwSA })
53
+ ctx := test .GetDeployContext (nil , []runtime.Object {dwPod })
47
54
containerBuildReconciler := NewContainerBuildReconciler ()
48
55
49
56
_ , done , err := containerBuildReconciler .Reconcile (ctx )
@@ -83,18 +90,25 @@ func TestContainerBuildReconciler(t *testing.T) {
83
90
}
84
91
85
92
func TestSyncAndRemoveRBAC (t * testing.T ) {
86
- dwSA := & corev1.ServiceAccount {
93
+ dwPod := & corev1.Pod {
87
94
TypeMeta : metav1.TypeMeta {
88
- Kind : "ServiceAccount " ,
95
+ Kind : "Pod " ,
89
96
APIVersion : "v1" ,
90
97
},
91
98
ObjectMeta : metav1.ObjectMeta {
92
- Name : constants . DevWorkspaceServiceAccountName ,
99
+ Name : "devworkspace-controller" ,
93
100
Namespace : "eclipse-che" ,
101
+ Labels : map [string ]string {
102
+ constants .KubernetesNameLabelKey : constants .DevWorkspaceControllerName ,
103
+ constants .KubernetesPartOfLabelKey : constants .DevWorkspaceOperatorName ,
104
+ },
105
+ },
106
+ Spec : corev1.PodSpec {
107
+ ServiceAccountName : constants .DevWorkspaceServiceAccountName ,
94
108
},
95
109
}
96
- ctx := test .GetDeployContext (nil , []runtime.Object {dwSA })
97
- ctx .CheCluster .Spec .DevEnvironments .DisableContainerBuildCapabilities = pointer .BoolPtr (false )
110
+ ctx := test .GetDeployContext (nil , []runtime.Object {dwPod })
111
+ ctx .CheCluster .Spec .DevEnvironments .DisableContainerBuildCapabilities = pointer .Bool (false )
98
112
ctx .CheCluster .Spec .DevEnvironments .ContainerBuildConfiguration = & chev2.ContainerBuildConfiguration {OpenShiftSecurityContextConstraint : "scc" }
99
113
100
114
containerBuildReconciler := NewContainerBuildReconciler ()
@@ -118,7 +132,7 @@ func TestSyncAndRemoveRBAC(t *testing.T) {
118
132
119
133
func TestSyncAndRemoveSCC (t * testing.T ) {
120
134
ctx := test .GetDeployContext (nil , []runtime.Object {})
121
- ctx .CheCluster .Spec .DevEnvironments .DisableContainerBuildCapabilities = pointer .BoolPtr (false )
135
+ ctx .CheCluster .Spec .DevEnvironments .DisableContainerBuildCapabilities = pointer .Bool (false )
122
136
ctx .CheCluster .Spec .DevEnvironments .ContainerBuildConfiguration = & chev2.ContainerBuildConfiguration {OpenShiftSecurityContextConstraint : "scc" }
123
137
124
138
containerBuildReconciler := NewContainerBuildReconciler ()
0 commit comments