Skip to content

Commit

Permalink
Merge pull request #119 from z103cb/z103cb/issue118
Browse files Browse the repository at this point in the history
Upgrade to MCAD v1.33.0
  • Loading branch information
openshift-merge-robot authored Aug 8, 2023
2 parents 58282c6 + f73ca2e commit 6870901
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 93 deletions.
5 changes: 2 additions & 3 deletions controllers/appWrapper_controller_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package controllers

import (
"testing"

"github.com/onsi/gomega"
arbv1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"testing"
)

func TestDiscoverInstanceTypes(t *testing.T) {
Expand Down Expand Up @@ -36,7 +37,6 @@ func TestDiscoverInstanceTypes(t *testing.T) {
Replicas: 2,
},
},
TypeMeta: metav1.TypeMeta{},
},
},
},
Expand Down Expand Up @@ -64,7 +64,6 @@ func TestDiscoverInstanceTypes(t *testing.T) {
Replicas: 1,
},
},
TypeMeta: metav1.TypeMeta{},
},
},
},
Expand Down
15 changes: 9 additions & 6 deletions controllers/appwrapper_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ import (
mapiclientset "github.com/openshift/client-go/machine/clientset/versioned"
machineinformersv1beta1 "github.com/openshift/client-go/machine/informers/externalversions"
"github.com/openshift/client-go/machine/listers/machine/v1beta1"

appwrapperClientSet "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned"

arbv1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1"
"github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/controller-versioned/clients"
arbinformers "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/informers/controller-externalversion"
v1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/listers/controller/v1"
appwrapperlisters "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/listers/controller/v1beta1"

arbinformersFactory "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/informers/externalversions"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
Expand Down Expand Up @@ -62,7 +65,7 @@ var (
machineLister v1beta1.MachineLister
msInformerHasSynced bool
machineClient mapiclientset.Interface
queueJobLister v1.AppWrapperLister
queueJobLister appwrapperlisters.AppWrapperLister
kubeClient *kubernetes.Clientset
)

Expand Down Expand Up @@ -199,11 +202,11 @@ func addAppwrappersThatNeedScaling() {
if err != nil {
klog.Fatalf("Error getting config: %v", err)
}
awJobClient, _, err := clients.NewClient(restConfig)
awJobClient, err := appwrapperClientSet.NewForConfig(restConfig)
if err != nil {
klog.Fatalf("Error creating client: %v", err)
}
queueJobInformer := arbinformers.NewSharedInformerFactory(awJobClient, 0).AppWrapper().AppWrappers()
queueJobInformer := arbinformersFactory.NewSharedInformerFactory(awJobClient, 0).Mcad().V1beta1().AppWrappers()
queueJobInformer.Informer().AddEventHandler(
cache.FilteringResourceEventHandler{
FilterFunc: func(obj interface{}) bool {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/openshift-online/ocm-sdk-go v0.1.327
github.com/openshift/api v0.0.0-20220411210816-c3bb724c282a
github.com/openshift/client-go v0.0.0-20211209144617-7385dd6338e3
github.com/project-codeflare/multi-cluster-app-dispatcher v1.32.0
github.com/project-codeflare/multi-cluster-app-dispatcher v1.33.0
k8s.io/api v0.23.0
k8s.io/apimachinery v0.23.0
k8s.io/client-go v0.23.0
Expand Down
Loading

0 comments on commit 6870901

Please sign in to comment.