Skip to content

Commit 942f3a1

Browse files
committed
Add VirtualService on Workspace conciliation
Signed-off-by: Matheus Cruz <[email protected]>
1 parent bfc174c commit 942f3a1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

workspaces/controller/internal/controller/workspace_controller_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ package controller
1818

1919
import (
2020
"fmt"
21+
"github.com/kubeflow/notebooks/workspaces/controller/internal/istio"
22+
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
2123
"time"
2224

2325
"k8s.io/utils/ptr"
@@ -189,6 +191,17 @@ var _ = Describe("Workspace Controller", func() {
189191

190192
// TODO: use this to get the Service
191193
//service := serviceList.Items[0]
194+
By("creating a VirtualService")
195+
virtualServiceList := &unstructured.UnstructuredList{}
196+
virtualServiceList.SetAPIVersion(istio.ApiVersionIstio)
197+
virtualServiceList.SetKind(istio.VirtualServiceKind)
198+
Eventually(func() ([]corev1.Service, error) {
199+
err := k8sClient.List(ctx, virtualServiceList, client.InNamespace(namespaceName), client.MatchingLabels{workspaceNameLabel: workspaceName})
200+
if err != nil {
201+
return nil, err
202+
}
203+
return serviceList.Items, nil
204+
}, timeout, interval).Should(HaveLen(1))
192205

193206
//
194207
// TODO: populate these tests

0 commit comments

Comments
 (0)