diff --git a/pilot/pkg/config/kube/crdclient/client_test.go b/pilot/pkg/config/kube/crdclient/client_test.go index b0f84b080902..3ff687f80c8e 100644 --- a/pilot/pkg/config/kube/crdclient/client_test.go +++ b/pilot/pkg/config/kube/crdclient/client_test.go @@ -15,7 +15,10 @@ package crdclient import ( + "context" "fmt" + "istio.io/api/networking/v1beta1" + apiistioioapinetworkingv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" "reflect" "testing" "time" @@ -433,3 +436,16 @@ func TestClientSync(t *testing.T) { // This MUST have been called by the time HasSynced returns true assert.Equal(t, events.Load(), 1) } + +func TestAlternativeVersions(t *testing.T) { + fake := kube.NewFakeClient() + fake.RunAndWait(test.NewStop(t)) + vs := apiistioioapinetworkingv1beta1.VirtualService{ + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{Name: "oo"}, + Spec: v1beta1.VirtualService{Hosts: []string{"hello"}}, + Status: v1alpha1.IstioStatus{}, + } + _, err := fake.Istio().NetworkingV1beta1().VirtualServices("test").Create(context.Background(), &vs, metav1.CreateOptions{}) + assert.NoError(t, err) +}