15
15
package crdclient
16
16
17
17
import (
18
+ "context"
18
19
"fmt"
19
20
"reflect"
20
21
"testing"
@@ -27,7 +28,9 @@ import (
27
28
28
29
"istio.io/api/meta/v1alpha1"
29
30
"istio.io/api/networking/v1alpha3"
31
+ "istio.io/api/networking/v1beta1"
30
32
clientnetworkingv1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3"
33
+ apiistioioapinetworkingv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1"
31
34
"istio.io/istio/pilot/pkg/model"
32
35
"istio.io/istio/pkg/config"
33
36
"istio.io/istio/pkg/config/schema/collection"
@@ -433,3 +436,16 @@ func TestClientSync(t *testing.T) {
433
436
// This MUST have been called by the time HasSynced returns true
434
437
assert .Equal (t , events .Load (), 1 )
435
438
}
439
+
440
+ func TestAlternativeVersions (t * testing.T ) {
441
+ fake := kube .NewFakeClient ()
442
+ fake .RunAndWait (test .NewStop (t ))
443
+ vs := apiistioioapinetworkingv1beta1.VirtualService {
444
+ TypeMeta : metav1.TypeMeta {},
445
+ ObjectMeta : metav1.ObjectMeta {Name : "oo" },
446
+ Spec : v1beta1.VirtualService {Hosts : []string {"hello" }},
447
+ Status : v1alpha1.IstioStatus {},
448
+ }
449
+ _ , err := fake .Istio ().NetworkingV1beta1 ().VirtualServices ("test" ).Create (context .Background (), & vs , metav1.CreateOptions {})
450
+ assert .NoError (t , err )
451
+ }
0 commit comments