@@ -3,11 +3,12 @@ package utils
33import (
44 "context"
55 "fmt"
6- appstacksv1 "github.com/application-stacks/runtime-component-operator/api/v1"
76 "reflect"
87 "strings"
98 "testing"
109
10+ appstacksv1 "github.com/application-stacks/runtime-component-operator/api/v1"
11+
1112 "github.com/application-stacks/runtime-component-operator/common"
1213
1314 routev1 "github.com/openshift/api/route/v1"
@@ -166,7 +167,7 @@ func TestGetDiscoveryClient(t *testing.T) {
166167 logger := zap .New ()
167168 logf .SetLogger (logger )
168169
169- runtimecomponent := createRuntimeComponent (name , namespace , spec )
170+ runtimecomponent := createRuntimeComponent (objMeta , spec )
170171 objs , s := []runtime.Object {runtimecomponent }, scheme .Scheme
171172 s .AddKnownTypes (appstacksv1 .GroupVersion , runtimecomponent )
172173 cl := fakeclient .NewFakeClient (objs ... )
@@ -186,7 +187,7 @@ func TestCreateOrUpdate(t *testing.T) {
186187 logf .SetLogger (logger )
187188 serviceAccount := & corev1.ServiceAccount {ObjectMeta : defaultMeta }
188189
189- runtimecomponent := createRuntimeComponent (name , namespace , spec )
190+ runtimecomponent := createRuntimeComponent (objMeta , spec )
190191 objs , s := []runtime.Object {runtimecomponent }, scheme .Scheme
191192 s .AddKnownTypes (appstacksv1 .GroupVersion , runtimecomponent )
192193 cl := fakeclient .NewFakeClient (objs ... )
@@ -207,7 +208,7 @@ func TestDeleteResources(t *testing.T) {
207208 logger := zap .New ()
208209 logf .SetLogger (logger )
209210
210- runtimecomponent := createRuntimeComponent (name , namespace , spec )
211+ runtimecomponent := createRuntimeComponent (objMeta , spec )
211212 objs , s := []runtime.Object {runtimecomponent }, scheme .Scheme
212213 s .AddKnownTypes (appstacksv1 .GroupVersion , runtimecomponent )
213214 cl := fakeclient .NewFakeClient (objs ... )
@@ -260,7 +261,7 @@ func TestGetOpConfigMap(t *testing.T) {
260261 },
261262 }
262263
263- runtimecomponent := createRuntimeComponent (name , namespace , spec )
264+ runtimecomponent := createRuntimeComponent (objMeta , spec )
264265 objs , s := []runtime.Object {runtimecomponent }, scheme .Scheme
265266 s .AddKnownTypes (appstacksv1 .GroupVersion , runtimecomponent )
266267 cl := fakeclient .NewFakeClient (objs ... )
@@ -286,7 +287,7 @@ func TestManageError(t *testing.T) {
286287 logf .SetLogger (logger )
287288 err := fmt .Errorf ("test-error" )
288289
289- runtimecomponent := createRuntimeComponent (name , namespace , spec )
290+ runtimecomponent := createRuntimeComponent (objMeta , spec )
290291 objs , s := []runtime.Object {runtimecomponent }, scheme .Scheme
291292 s .AddKnownTypes (appstacksv1 .GroupVersion , runtimecomponent )
292293 cl := fakeclient .NewFakeClient (objs ... )
@@ -307,7 +308,7 @@ func TestManageSuccess(t *testing.T) {
307308 logger := zap .New ()
308309 logf .SetLogger (logger )
309310
310- runtimecomponent := createRuntimeComponent (name , namespace , spec )
311+ runtimecomponent := createRuntimeComponent (objMeta , spec )
311312 objs , s := []runtime.Object {runtimecomponent }, scheme .Scheme
312313 s .AddKnownTypes (appstacksv1 .GroupVersion , runtimecomponent )
313314 cl := fakeclient .NewFakeClient (objs ... )
@@ -326,7 +327,7 @@ func TestIsGroupVersionSupported(t *testing.T) {
326327 logger := zap .New ()
327328 logf .SetLogger (logger )
328329
329- runtimecomponent := createRuntimeComponent (name , namespace , spec )
330+ runtimecomponent := createRuntimeComponent (objMeta , spec )
330331 objs , s := []runtime.Object {runtimecomponent }, scheme .Scheme
331332 s .AddKnownTypes (appstacksv1 .GroupVersion , runtimecomponent )
332333 cl := fakeclient .NewFakeClient (objs ... )
@@ -363,7 +364,7 @@ func TestIsGroupVersionSupported(t *testing.T) {
363364func testGetSvcTLSValues (t * testing.T ) {
364365 // Configure the runtime component
365366
366- runtimecomponent := createRuntimeComponent (name , namespace , spec )
367+ runtimecomponent := createRuntimeComponent (objMeta , spec )
367368 expose := true
368369 runtimecomponent .Spec .Expose = & expose
369370 runtimecomponent .Spec .Service = & appstacksv1.RuntimeComponentService {
@@ -404,7 +405,7 @@ func testGetSvcTLSValues(t *testing.T) {
404405// testGetRouteTLSValues test the function GetRouteTLSValues in reconciler.go.
405406func testGetRouteTLSValues (t * testing.T ) {
406407 // Configure the rumtime component
407- runtimecomponent := createRuntimeComponent (name , namespace , spec )
408+ runtimecomponent := createRuntimeComponent (objMeta , spec )
408409 terminationPolicy := routev1 .TLSTerminationReencrypt
409410 secretRefName := "my-app-route-tls"
410411 runtimecomponent .Spec .Expose = & expose
0 commit comments