Skip to content

Commit

Permalink
Update operator tests to run against machine.openshift.io
Browse files Browse the repository at this point in the history
  • Loading branch information
enxebre committed Feb 4, 2019
1 parent e15b6f5 commit 4773449
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions test/e2e/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/golang/glog"
osconfigv1 "github.com/openshift/api/config/v1"
capiv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1"
mapiv1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1"
caov1alpha1 "github.com/openshift/cluster-autoscaler-operator/pkg/apis"
"k8s.io/client-go/kubernetes/scheme"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand All @@ -17,7 +17,7 @@ const (
)

func init() {
if err := capiv1alpha1.AddToScheme(scheme.Scheme); err != nil {
if err := mapiv1beta1.AddToScheme(scheme.Scheme); err != nil {
glog.Fatal(err)
}

Expand Down
18 changes: 9 additions & 9 deletions test/e2e/operator_expectations.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/golang/glog"
osconfigv1 "github.com/openshift/api/config/v1"
capiv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1"
mapiv1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1"
caov1alpha1 "github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1alpha1"
cvoresourcemerge "github.com/openshift/cluster-version-operator/lib/resourcemerge"
kappsapi "k8s.io/api/apps/v1"
Expand Down Expand Up @@ -55,7 +55,7 @@ func (tc *testConfig) ExpectOneClusterObject() error {
listOptions := client.ListOptions{
Namespace: namespace,
}
clusterList := capiv1alpha1.ClusterList{}
clusterList := mapiv1beta1.ClusterList{}

err := wait.PollImmediate(1*time.Second, waitShort, func() (bool, error) {
if err := tc.client.List(context.TODO(), &listOptions, &clusterList); err != nil {
Expand Down Expand Up @@ -98,7 +98,7 @@ func (tc *testConfig) ExpectAllMachinesLinkedToANode() error {
listOptions := client.ListOptions{
Namespace: namespace,
}
machineList := capiv1alpha1.MachineList{}
machineList := mapiv1beta1.MachineList{}
nodeList := corev1.NodeList{}

err := wait.PollImmediate(1*time.Second, waitShort, func() (bool, error) {
Expand Down Expand Up @@ -187,7 +187,7 @@ func (tc *testConfig) ExpectAdditiveReconcileMachineTaints() error {
listOptions := client.ListOptions{
Namespace: namespace,
}
machineList := capiv1alpha1.MachineList{}
machineList := mapiv1beta1.MachineList{}

if err := tc.client.List(context.TODO(), &listOptions, &machineList); err != nil {
return fmt.Errorf("error querying api for machineList object: %v", err)
Expand Down Expand Up @@ -255,7 +255,7 @@ func (tc *testConfig) ExpectNewNodeWhenDeletingMachine() error {
listOptions := client.ListOptions{
Namespace: namespace,
}
machineList := capiv1alpha1.MachineList{}
machineList := mapiv1beta1.MachineList{}
nodeList := corev1.NodeList{}

glog.Info("Get machineList")
Expand Down Expand Up @@ -284,7 +284,7 @@ func (tc *testConfig) ExpectNewNodeWhenDeletingMachine() error {

clusterInitialTotalNodes := len(nodeList.Items)
clusterInitialTotalMachines := len(machineList.Items)
var triagedWorkerMachine capiv1alpha1.Machine
var triagedWorkerMachine mapiv1beta1.Machine
var triagedWorkerNode corev1.Node
MachineLoop:
for _, m := range machineList.Items {
Expand Down Expand Up @@ -361,7 +361,7 @@ func (tc *testConfig) ExpectAutoscalerScalesOut() error {
Namespace: namespace,
}
glog.Info("Get one machineSet")
machineSetList := capiv1alpha1.MachineSetList{}
machineSetList := mapiv1beta1.MachineSetList{}
err := wait.PollImmediate(1*time.Second, waitMedium, func() (bool, error) {
if err := tc.client.List(context.TODO(), &listOptions, &machineSetList); err != nil {
glog.Errorf("error querying api for nodeList object: %v, retrying...", err)
Expand Down Expand Up @@ -513,7 +513,7 @@ func (tc *testConfig) ExpectAutoscalerScalesOut() error {
Namespace: namespace,
Name: targetMachineSet.Name,
}
ms := &capiv1alpha1.MachineSet{}
ms := &mapiv1beta1.MachineSet{}
if err := tc.client.Get(context.TODO(), msKey, ms); err != nil {
glog.Errorf("error querying api for clusterAutoscaler object: %v, retrying...", err)
return false, nil
Expand Down Expand Up @@ -581,7 +581,7 @@ func (tc *testConfig) ExpectAutoscalerScalesOut() error {
Namespace: namespace,
Name: targetMachineSet.Name,
}
ms := &capiv1alpha1.MachineSet{}
ms := &mapiv1beta1.MachineSet{}
if err := tc.client.Get(context.TODO(), msKey, ms); err != nil {
glog.Errorf("error querying api for machineSet object: %v, retrying...", err)
return false, nil
Expand Down

0 comments on commit 4773449

Please sign in to comment.