Skip to content

Commit 4932336

Browse files
Merge pull request #202 from enxebre/machine-api-namespace
Deploy components into openshift-machine-api namespace
2 parents ea1bcd2 + 972c37a commit 4932336

16 files changed

+37
-29
lines changed

cmd/machine-api-operator/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
const (
1111
componentName = "machine-api-operator"
12-
componentNamespace = "openshift-cluster-api"
12+
componentNamespace = "openshift-machine-api"
1313
)
1414

1515
var (
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
kind: Namespace
33
metadata:
4-
name: openshift-cluster-api
4+
name: openshift-machine-api
55
labels:
6-
name: openshift-cluster-api
6+
name: openshift-machine-api
77
openshift.io/run-level: "1"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: openshift-cluster-api
5+
labels:
6+
name: openshift-cluster-api
7+
openshift.io/run-level: "1"

install/0000_30_machine-api-operator_01_images.configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ apiVersion: v1
22
kind: ConfigMap
33
metadata:
44
name: machine-api-operator-images
5-
namespace: openshift-cluster-api
5+
namespace: openshift-machine-api
66
data:
77
images.json: '{"machineAPIOperator": "docker.io/openshift/origin-machine-api-operator:v4.0.0", "clusterAPIControllerAWS": "docker.io/openshift/origin-aws-machine-controllers:v4.0.0", "clusterAPIControllerOpenStack": "docker.io/openshift/origin-openstack-machine-controllers:v4.0.0", "clusterAPIControllerLibvirt": "docker.io/openshift/origin-libvirt-machine-controllers:v4.0.0"}'

install/0000_30_machine-api-operator_13_rbac.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
kind: ClusterRoleBinding
33
apiVersion: rbac.authorization.k8s.io/v1beta1
44
metadata:
5-
name: default-account-openshift-cluster-api
5+
name: default-account-openshift-machine-api
66
subjects:
77
- kind: ServiceAccount
88
name: default
9-
namespace: openshift-cluster-api
9+
namespace: openshift-machine-api
1010
roleRef:
1111
kind: ClusterRole
1212
name: cluster-admin

install/0000_30_machine-api-operator_14_deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apps/v1beta2
22
kind: Deployment
33
metadata:
44
name: machine-api-operator
5-
namespace: openshift-cluster-api
5+
namespace: openshift-machine-api
66
labels:
77
k8s-app: machine-api-operator
88
spec:

test/e2e/main.go

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

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

1920
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: namespace,
56+
Namespace: deprecatedNamespace,
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: namespace,
99+
Namespace: deprecatedNamespace,
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", namespace, machine.Name) {
131+
if nodeNameToMachineAnnotation[nodeName] != fmt.Sprintf("%s/%s", deprecatedNamespace, 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: namespace,
188+
Namespace: deprecatedNamespace,
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: namespace,
204+
Namespace: deprecatedNamespace,
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: namespace,
256+
Namespace: deprecatedNamespace,
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: namespace,
361+
Namespace: deprecatedNamespace,
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: namespace,
389+
Namespace: deprecatedNamespace,
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: namespace,
399+
Namespace: deprecatedNamespace,
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: namespace,
465+
Namespace: deprecatedNamespace,
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: namespace,
513+
Namespace: deprecatedNamespace,
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: namespace,
581+
Namespace: deprecatedNamespace,
582582
Name: targetMachineSet.Name,
583583
}
584584
ms := &mapiv1beta1.MachineSet{}

test/integration/generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ apiVersion: v1
77
kind: Secret
88
metadata:
99
name: aws-credentials-secret
10-
namespace: openshift-cluster-api
10+
namespace: openshift-machine-api
1111
type: Opaque
1212
data:
1313
awsAccessKeyId: $(echo -n $(aws configure get aws_access_key_id) | base64)

test/integration/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const (
3838
timeoutPoolMachineSetRunningInterval = 10 * time.Minute
3939

4040
defaultLogLevel = "info"
41-
targetNamespace = "openshift-cluster-api"
41+
targetNamespace = "openshift-machine-api"
4242
awsCredentialsSecretName = "aws-credentials-secret"
4343
region = "us-east-1"
4444
machineSetReplicas = 2

test/integration/manifests/cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: machine.openshift.io/v1beta1
22
kind: Cluster
33
metadata:
44
name: {{ .ClusterID }}
5-
namespace: openshift-cluster-api
5+
namespace: openshift-machine-api
66
spec:
77
clusterNetwork:
88
pods:

test/integration/manifests/ign-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
kind: Secret
33
metadata:
44
name: ignition-worker
5-
namespace: openshift-cluster-api
5+
namespace: openshift-machine-api
66
type: Opaque
77
data:
88
userData: ""

test/integration/manifests/images.configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
kind: ConfigMap
33
metadata:
44
name: machine-api-operator-images
5-
namespace: openshift-cluster-api
5+
namespace: openshift-machine-api
66
data:
77
images.json: '{
88
"clusterAPIControllerAWS": "docker.io/openshift/origin-aws-machine-controllers:v4.0.0",

test/integration/manifests/machineset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
sigs.k8s.io/cluster-api-machine-role: worker
77
sigs.k8s.io/cluster-api-machine-type: worker
88
name: worker
9-
namespace: openshift-cluster-api
9+
namespace: openshift-machine-api
1010
spec:
1111
replicas: 2
1212
selector:

test/integration/manifests/operator-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apps/v1beta2
22
kind: Deployment
33
metadata:
44
name: machine-api-operator
5-
namespace: openshift-cluster-api
5+
namespace: openshift-machine-api
66
labels:
77
k8s-app: machine-api-operator
88
spec:

test/integration/manifests/rbac.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
kind: ClusterRoleBinding
33
apiVersion: rbac.authorization.k8s.io/v1beta1
44
metadata:
5-
name: default-account-openshift-cluster-api
5+
name: default-account-openshift-machine-api
66
subjects:
77
- kind: ServiceAccount
88
name: default
9-
namespace: openshift-cluster-api
9+
namespace: openshift-machine-api
1010
roleRef:
1111
kind: ClusterRole
1212
name: cluster-admin

0 commit comments

Comments
 (0)