Skip to content

Commit

Permalink
Add a test to ensure we can handle alt client-go versions
Browse files Browse the repository at this point in the history
Test to ensure istio/api#3127 work doesn't
cause regressions
  • Loading branch information
howardjohn committed May 10, 2024
1 parent 0e57b81 commit c2be218
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pilot/pkg/config/kube/crdclient/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}

0 comments on commit c2be218

Please sign in to comment.