MCPcopy Create free account
hub / github.com/devfile/devworkspace-operator / TestDetectsOpenShiftRouteSuffix

Function TestDetectsOpenShiftRouteSuffix

pkg/config/sync_test.go:248–266  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

246}
247
248func TestDetectsOpenShiftRouteSuffix(t *testing.T) {
249 setupForTest(t)
250 infrastructure.InitializeForTesting(infrastructure.OpenShiftv4)
251 testRoute := &routev1.Route{
252 ObjectMeta: metav1.ObjectMeta{
253 Name: openShiftTestRouteName,
254 Namespace: testNamespace,
255 },
256 Spec: routev1.RouteSpec{
257 Host: "test-host",
258 },
259 }
260 client := fake.NewClientBuilder().WithScheme(scheme).WithObjects(testRoute).Build()
261 err := SetupControllerConfig(client)
262 if !assert.NoError(t, err, "Should not return error") {
263 return
264 }
265 assert.Equal(t, "test-host", internalConfig.Routing.ClusterHostSuffix, "Should determine host suffix with route on OpenShift")
266}
267
268func TestSyncConfigFromIgnoresOtherConfigInOtherNamespaces(t *testing.T) {
269 setupForTest(t)

Callers

nothing calls this directly

Calls 3

InitializeForTestingFunction · 0.92
setupForTestFunction · 0.85
SetupControllerConfigFunction · 0.85

Tested by

no test coverage detected