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

Function markRoutingReady

controllers/workspace/util_test.go:170–193  ·  view source on GitHub ↗
(mainUrl, routingName string)

Source from the content-addressed store, hash-verified

168}
169
170func markRoutingReady(mainUrl, routingName string) {
171 namespacedName := namespacedName(routingName, testNamespace)
172 routing := &controllerv1alpha1.DevWorkspaceRouting{}
173 Eventually(func() error {
174 err := k8sClient.Get(ctx, namespacedName, routing)
175 if err != nil {
176 return err
177 }
178 routing.Status.Phase = controllerv1alpha1.RoutingReady
179 mainAttributes := controllerv1alpha1.Attributes{}
180 mainAttributes.PutString("type", "main")
181 exposedEndpoint := controllerv1alpha1.ExposedEndpoint{
182 Name: "test-endpoint",
183 Url: mainUrl,
184 Attributes: mainAttributes,
185 }
186 routing.Status.ExposedEndpoints = map[string]controllerv1alpha1.ExposedEndpointList{
187 "test-endpoint": {
188 exposedEndpoint,
189 },
190 }
191 return k8sClient.Status().Update(ctx, routing)
192 }, 30*time.Second, 250*time.Millisecond).Should(Succeed(), "Update DevWorkspaceRouting to have mainUrl and be ready")
193}
194
195func markDeploymentReady(deploymentName string) {
196 namespacedName := namespacedName(deploymentName, testNamespace)

Calls 3

PutStringMethod · 0.95
namespacedNameFunction · 0.70
GetMethod · 0.65

Tested by

no test coverage detected