Skip to content

Commit 2732922

Browse files
Merge pull request #207 from enxebre/drop-deprecated-namespace-dup
Drop deprecated namespace from tests
2 parents 4932336 + 6a362a1 commit 2732922

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

pkg/controller/machinehealthcheck/machinehealthcheck_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
)
2121

2222
const (
23-
namespace = "openshift-cluster-api"
23+
namespace = "openshift-machine-api"
2424
)
2525

2626
var (

test/e2e/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import (
1313
)
1414

1515
const (
16-
deprecatedNamespace = "openshift-cluster-api"
17-
namespace = "openshift-machine-api"
16+
namespace = "openshift-machine-api"
1817
)
1918

2019
func init() {

test/e2e/operator_expectations.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (tc *testConfig) ExpectOperatorAvailable() error {
5353

5454
func (tc *testConfig) ExpectNoClusterObject() error {
5555
listOptions := client.ListOptions{
56-
Namespace: deprecatedNamespace,
56+
Namespace: namespace,
5757
}
5858
clusterList := mapiv1beta1.ClusterList{}
5959

@@ -96,7 +96,7 @@ func (tc *testConfig) ExpectClusterOperatorStatusAvailable() error {
9696
func (tc *testConfig) ExpectAllMachinesLinkedToANode() error {
9797
machineAnnotationKey := "machine.openshift.io/machine"
9898
listOptions := client.ListOptions{
99-
Namespace: deprecatedNamespace,
99+
Namespace: namespace,
100100
}
101101
machineList := mapiv1beta1.MachineList{}
102102
nodeList := corev1.NodeList{}
@@ -128,7 +128,7 @@ func (tc *testConfig) ExpectAllMachinesLinkedToANode() error {
128128
return false, nil
129129
}
130130
nodeName := machine.Status.NodeRef.Name
131-
if nodeNameToMachineAnnotation[nodeName] != fmt.Sprintf("%s/%s", deprecatedNamespace, machine.Name) {
131+
if nodeNameToMachineAnnotation[nodeName] != fmt.Sprintf("%s/%s", namespace, machine.Name) {
132132
glog.Errorf("node name %s does not match expected machine name %s, retrying...", nodeName, machine.Name)
133133
return false, nil
134134
}
@@ -185,7 +185,7 @@ func (tc *testConfig) ExpectReconcileControllersDeployment() error {
185185
func (tc *testConfig) ExpectAdditiveReconcileMachineTaints() error {
186186
glog.Info("Verify machine taints are getting applied to node")
187187
listOptions := client.ListOptions{
188-
Namespace: deprecatedNamespace,
188+
Namespace: namespace,
189189
}
190190
machineList := mapiv1beta1.MachineList{}
191191

@@ -201,7 +201,7 @@ func (tc *testConfig) ExpectAdditiveReconcileMachineTaints() error {
201201
glog.Infof("Got the machine, %s", machine.Name)
202202
nodeName := machine.Status.NodeRef.Name
203203
nodeKey := types.NamespacedName{
204-
Namespace: deprecatedNamespace,
204+
Namespace: namespace,
205205
Name: nodeName,
206206
}
207207
node := &corev1.Node{}
@@ -253,7 +253,7 @@ func (tc *testConfig) ExpectAdditiveReconcileMachineTaints() error {
253253

254254
func (tc *testConfig) ExpectNewNodeWhenDeletingMachine() error {
255255
listOptions := client.ListOptions{
256-
Namespace: deprecatedNamespace,
256+
Namespace: namespace,
257257
}
258258
machineList := mapiv1beta1.MachineList{}
259259
nodeList := corev1.NodeList{}
@@ -358,7 +358,7 @@ MachineLoop:
358358
// Ensure initial number of replicas and nodes
359359
func (tc *testConfig) ExpectAutoscalerScalesOut() error {
360360
listOptions := client.ListOptions{
361-
Namespace: deprecatedNamespace,
361+
Namespace: namespace,
362362
}
363363
glog.Info("Get one machineSet")
364364
machineSetList := mapiv1beta1.MachineSetList{}
@@ -386,7 +386,7 @@ func (tc *testConfig) ExpectAutoscalerScalesOut() error {
386386
clusterAutoscaler := caov1alpha1.ClusterAutoscaler{
387387
ObjectMeta: metav1.ObjectMeta{
388388
Name: "default",
389-
Namespace: deprecatedNamespace,
389+
Namespace: namespace,
390390
},
391391
TypeMeta: metav1.TypeMeta{
392392
Kind: "ClusterAutoscaler",
@@ -396,7 +396,7 @@ func (tc *testConfig) ExpectAutoscalerScalesOut() error {
396396
machineAutoscaler := caov1alpha1.MachineAutoscaler{
397397
ObjectMeta: metav1.ObjectMeta{
398398
GenerateName: fmt.Sprintf("autoscale-%s", targetMachineSet.Name),
399-
Namespace: deprecatedNamespace,
399+
Namespace: namespace,
400400
},
401401
TypeMeta: metav1.TypeMeta{
402402
Kind: "MachineAutoscaler",
@@ -462,7 +462,7 @@ func (tc *testConfig) ExpectAutoscalerScalesOut() error {
462462
workLoad := batchv1.Job{
463463
ObjectMeta: metav1.ObjectMeta{
464464
Name: "workload",
465-
Namespace: deprecatedNamespace,
465+
Namespace: namespace,
466466
},
467467
TypeMeta: metav1.TypeMeta{
468468
Kind: "Job",
@@ -510,7 +510,7 @@ func (tc *testConfig) ExpectAutoscalerScalesOut() error {
510510
glog.Info("Wait for cluster to scale out number of replicas")
511511
err = wait.PollImmediate(1*time.Second, waitLong, func() (bool, error) {
512512
msKey := types.NamespacedName{
513-
Namespace: deprecatedNamespace,
513+
Namespace: namespace,
514514
Name: targetMachineSet.Name,
515515
}
516516
ms := &mapiv1beta1.MachineSet{}
@@ -578,7 +578,7 @@ func (tc *testConfig) ExpectAutoscalerScalesOut() error {
578578
glog.Infof("Ensure initial number of replicas: %d", initialNumberOfReplicas)
579579
err = wait.PollImmediate(1*time.Second, waitShort, func() (bool, error) {
580580
msKey := types.NamespacedName{
581-
Namespace: deprecatedNamespace,
581+
Namespace: namespace,
582582
Name: targetMachineSet.Name,
583583
}
584584
ms := &mapiv1beta1.MachineSet{}

0 commit comments

Comments
 (0)