apf: update e2e test to use v1beta2

This commit is contained in:
Abu Kashem
2021-08-16 17:12:42 -04:00
parent 2f19f8c2df
commit d99497ef6d
5 changed files with 15 additions and 15 deletions

View File

@@ -28,7 +28,7 @@ import (
"github.com/prometheus/common/expfmt"
"github.com/prometheus/common/model"
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/wait"
@@ -235,7 +235,7 @@ func getRequestCountOfPriorityLevel(c clientset.Interface) (map[string]int, map[
}
func createPriorityLevelAndBindingFlowSchemaForUser(c clientset.Interface, username string, concurrencyShares, queuelength int) (*flowcontrol.PriorityLevelConfiguration, *flowcontrol.FlowSchema, error) {
pl, err := c.FlowcontrolV1beta1().PriorityLevelConfigurations().Create(context.Background(), &flowcontrol.PriorityLevelConfiguration{
pl, err := c.FlowcontrolV1beta2().PriorityLevelConfigurations().Create(context.Background(), &flowcontrol.PriorityLevelConfiguration{
ObjectMeta: metav1.ObjectMeta{
Name: username,
},
@@ -257,7 +257,7 @@ func createPriorityLevelAndBindingFlowSchemaForUser(c clientset.Interface, usern
if err != nil {
return nil, nil, err
}
fs, err := c.FlowcontrolV1beta1().FlowSchemas().Create(context.TODO(), &flowcontrol.FlowSchema{
fs, err := c.FlowcontrolV1beta2().FlowSchemas().Create(context.TODO(), &flowcontrol.FlowSchema{
ObjectMeta: metav1.ObjectMeta{
Name: username,
},
@@ -297,7 +297,7 @@ func createPriorityLevelAndBindingFlowSchemaForUser(c clientset.Interface, usern
}
return pl, fs, wait.Poll(time.Second, timeout, func() (bool, error) {
fs, err := c.FlowcontrolV1beta1().FlowSchemas().Get(context.TODO(), username, metav1.GetOptions{})
fs, err := c.FlowcontrolV1beta2().FlowSchemas().Get(context.TODO(), username, metav1.GetOptions{})
if err != nil {
return false, err
}

View File

@@ -25,7 +25,7 @@ import (
"testing"
"time"
flowcontrol "k8s.io/api/flowcontrol/v1beta1"
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
"k8s.io/apimachinery/pkg/util/clock"
genericfeatures "k8s.io/apiserver/pkg/features"
utilfeature "k8s.io/apiserver/pkg/util/feature"
@@ -95,7 +95,7 @@ func (ft *fightTest) createMainInformer() {
myConfig = rest.AddUserAgent(myConfig, "audience")
myClientset := clientset.NewForConfigOrDie(myConfig)
informerFactory := informers.NewSharedInformerFactory(myClientset, 0)
inf := informerFactory.Flowcontrol().V1beta1().FlowSchemas().Informer()
inf := informerFactory.Flowcontrol().V1beta2().FlowSchemas().Informer()
inf.AddEventHandler(cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
fs := obj.(*flowcontrol.FlowSchema)
@@ -123,7 +123,7 @@ func (ft *fightTest) createController(invert bool, i int) {
myConfig := rest.CopyConfig(ft.loopbackConfig)
myConfig = rest.AddUserAgent(myConfig, fieldMgr)
myClientset := clientset.NewForConfigOrDie(myConfig)
fcIfc := myClientset.FlowcontrolV1beta1()
fcIfc := myClientset.FlowcontrolV1beta2()
informerFactory := informers.NewSharedInformerFactory(myClientset, 0)
foundToDangling := func(found bool) bool { return !found }
if invert {