Skip to content

Commit

Permalink
Add VirtualService on Workspace conciliation
Browse files Browse the repository at this point in the history
Signed-off-by: Matheus Cruz <[email protected]>
  • Loading branch information
mcruzdev committed Sep 15, 2024
1 parent bfc174c commit 942f3a1
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ package controller

import (
"fmt"
"github.com/kubeflow/notebooks/workspaces/controller/internal/istio"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"time"

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

// TODO: use this to get the Service
//service := serviceList.Items[0]
By("creating a VirtualService")
virtualServiceList := &unstructured.UnstructuredList{}
virtualServiceList.SetAPIVersion(istio.ApiVersionIstio)
virtualServiceList.SetKind(istio.VirtualServiceKind)
Eventually(func() ([]corev1.Service, error) {
err := k8sClient.List(ctx, virtualServiceList, client.InNamespace(namespaceName), client.MatchingLabels{workspaceNameLabel: workspaceName})
if err != nil {
return nil, err
}
return serviceList.Items, nil
}, timeout, interval).Should(HaveLen(1))

//
// TODO: populate these tests
Expand Down

0 comments on commit 942f3a1

Please sign in to comment.