Skip to content

Deploy components into openshift-machine-api namespace #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/machine-api-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

const (
componentName = "machine-api-operator"
componentNamespace = "openshift-cluster-api"
componentNamespace = "openshift-machine-api"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions install/0000_30_machine-api-operator_00_namespace.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
name: openshift-cluster-api
name: openshift-machine-api
labels:
name: openshift-cluster-api
name: openshift-machine-api
openshift.io/run-level: "1"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
name: openshift-cluster-api
labels:
name: openshift-cluster-api
openshift.io/run-level: "1"
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: machine-api-operator-images
namespace: openshift-cluster-api
namespace: openshift-machine-api
data:
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"}'
4 changes: 2 additions & 2 deletions install/0000_30_machine-api-operator_13_rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: default-account-openshift-cluster-api
name: default-account-openshift-machine-api
subjects:
- kind: ServiceAccount
name: default
namespace: openshift-cluster-api
namespace: openshift-machine-api
roleRef:
kind: ClusterRole
name: cluster-admin
Expand Down
2 changes: 1 addition & 1 deletion install/0000_30_machine-api-operator_14_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: machine-api-operator
namespace: openshift-cluster-api
namespace: openshift-machine-api
labels:
k8s-app: machine-api-operator
spec:
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (
)

const (
namespace = "openshift-cluster-api"
deprecatedNamespace = "openshift-cluster-api"
namespace = "openshift-machine-api"
)

func init() {
Expand Down
24 changes: 12 additions & 12 deletions test/e2e/operator_expectations.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (tc *testConfig) ExpectOperatorAvailable() error {

func (tc *testConfig) ExpectNoClusterObject() error {
listOptions := client.ListOptions{
Namespace: namespace,
Namespace: deprecatedNamespace,
}
clusterList := mapiv1beta1.ClusterList{}

Expand Down Expand Up @@ -96,7 +96,7 @@ func (tc *testConfig) ExpectClusterOperatorStatusAvailable() error {
func (tc *testConfig) ExpectAllMachinesLinkedToANode() error {
machineAnnotationKey := "machine.openshift.io/machine"
listOptions := client.ListOptions{
Namespace: namespace,
Namespace: deprecatedNamespace,
}
machineList := mapiv1beta1.MachineList{}
nodeList := corev1.NodeList{}
Expand Down Expand Up @@ -128,7 +128,7 @@ func (tc *testConfig) ExpectAllMachinesLinkedToANode() error {
return false, nil
}
nodeName := machine.Status.NodeRef.Name
if nodeNameToMachineAnnotation[nodeName] != fmt.Sprintf("%s/%s", namespace, machine.Name) {
if nodeNameToMachineAnnotation[nodeName] != fmt.Sprintf("%s/%s", deprecatedNamespace, machine.Name) {
glog.Errorf("node name %s does not match expected machine name %s, retrying...", nodeName, machine.Name)
return false, nil
}
Expand Down Expand Up @@ -185,7 +185,7 @@ func (tc *testConfig) ExpectReconcileControllersDeployment() error {
func (tc *testConfig) ExpectAdditiveReconcileMachineTaints() error {
glog.Info("Verify machine taints are getting applied to node")
listOptions := client.ListOptions{
Namespace: namespace,
Namespace: deprecatedNamespace,
}
machineList := mapiv1beta1.MachineList{}

Expand All @@ -201,7 +201,7 @@ func (tc *testConfig) ExpectAdditiveReconcileMachineTaints() error {
glog.Infof("Got the machine, %s", machine.Name)
nodeName := machine.Status.NodeRef.Name
nodeKey := types.NamespacedName{
Namespace: namespace,
Namespace: deprecatedNamespace,
Name: nodeName,
}
node := &corev1.Node{}
Expand Down Expand Up @@ -253,7 +253,7 @@ func (tc *testConfig) ExpectAdditiveReconcileMachineTaints() error {

func (tc *testConfig) ExpectNewNodeWhenDeletingMachine() error {
listOptions := client.ListOptions{
Namespace: namespace,
Namespace: deprecatedNamespace,
}
machineList := mapiv1beta1.MachineList{}
nodeList := corev1.NodeList{}
Expand Down Expand Up @@ -358,7 +358,7 @@ MachineLoop:
// Ensure initial number of replicas and nodes
func (tc *testConfig) ExpectAutoscalerScalesOut() error {
listOptions := client.ListOptions{
Namespace: namespace,
Namespace: deprecatedNamespace,
}
glog.Info("Get one machineSet")
machineSetList := mapiv1beta1.MachineSetList{}
Expand Down Expand Up @@ -386,7 +386,7 @@ func (tc *testConfig) ExpectAutoscalerScalesOut() error {
clusterAutoscaler := caov1alpha1.ClusterAutoscaler{
ObjectMeta: metav1.ObjectMeta{
Name: "default",
Namespace: namespace,
Namespace: deprecatedNamespace,
},
TypeMeta: metav1.TypeMeta{
Kind: "ClusterAutoscaler",
Expand All @@ -396,7 +396,7 @@ func (tc *testConfig) ExpectAutoscalerScalesOut() error {
machineAutoscaler := caov1alpha1.MachineAutoscaler{
ObjectMeta: metav1.ObjectMeta{
GenerateName: fmt.Sprintf("autoscale-%s", targetMachineSet.Name),
Namespace: namespace,
Namespace: deprecatedNamespace,
},
TypeMeta: metav1.TypeMeta{
Kind: "MachineAutoscaler",
Expand Down Expand Up @@ -462,7 +462,7 @@ func (tc *testConfig) ExpectAutoscalerScalesOut() error {
workLoad := batchv1.Job{
ObjectMeta: metav1.ObjectMeta{
Name: "workload",
Namespace: namespace,
Namespace: deprecatedNamespace,
},
TypeMeta: metav1.TypeMeta{
Kind: "Job",
Expand Down Expand Up @@ -510,7 +510,7 @@ func (tc *testConfig) ExpectAutoscalerScalesOut() error {
glog.Info("Wait for cluster to scale out number of replicas")
err = wait.PollImmediate(1*time.Second, waitLong, func() (bool, error) {
msKey := types.NamespacedName{
Namespace: namespace,
Namespace: deprecatedNamespace,
Name: targetMachineSet.Name,
}
ms := &mapiv1beta1.MachineSet{}
Expand Down Expand Up @@ -578,7 +578,7 @@ func (tc *testConfig) ExpectAutoscalerScalesOut() error {
glog.Infof("Ensure initial number of replicas: %d", initialNumberOfReplicas)
err = wait.PollImmediate(1*time.Second, waitShort, func() (bool, error) {
msKey := types.NamespacedName{
Namespace: namespace,
Namespace: deprecatedNamespace,
Name: targetMachineSet.Name,
}
ms := &mapiv1beta1.MachineSet{}
Expand Down
2 changes: 1 addition & 1 deletion test/integration/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apiVersion: v1
kind: Secret
metadata:
name: aws-credentials-secret
namespace: openshift-cluster-api
namespace: openshift-machine-api
type: Opaque
data:
awsAccessKeyId: $(echo -n $(aws configure get aws_access_key_id) | base64)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const (
timeoutPoolMachineSetRunningInterval = 10 * time.Minute

defaultLogLevel = "info"
targetNamespace = "openshift-cluster-api"
targetNamespace = "openshift-machine-api"
awsCredentialsSecretName = "aws-credentials-secret"
region = "us-east-1"
machineSetReplicas = 2
Expand Down
2 changes: 1 addition & 1 deletion test/integration/manifests/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: machine.openshift.io/v1beta1
kind: Cluster
metadata:
name: {{ .ClusterID }}
namespace: openshift-cluster-api
namespace: openshift-machine-api
spec:
clusterNetwork:
pods:
Expand Down
2 changes: 1 addition & 1 deletion test/integration/manifests/ign-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Secret
metadata:
name: ignition-worker
namespace: openshift-cluster-api
namespace: openshift-machine-api
type: Opaque
data:
userData: ""
2 changes: 1 addition & 1 deletion test/integration/manifests/images.configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: machine-api-operator-images
namespace: openshift-cluster-api
namespace: openshift-machine-api
data:
images.json: '{
"clusterAPIControllerAWS": "docker.io/openshift/origin-aws-machine-controllers:v4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion test/integration/manifests/machineset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
sigs.k8s.io/cluster-api-machine-role: worker
sigs.k8s.io/cluster-api-machine-type: worker
name: worker
namespace: openshift-cluster-api
namespace: openshift-machine-api
spec:
replicas: 2
selector:
Expand Down
2 changes: 1 addition & 1 deletion test/integration/manifests/operator-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: machine-api-operator
namespace: openshift-cluster-api
namespace: openshift-machine-api
labels:
k8s-app: machine-api-operator
spec:
Expand Down
4 changes: 2 additions & 2 deletions test/integration/manifests/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: default-account-openshift-cluster-api
name: default-account-openshift-machine-api
subjects:
- kind: ServiceAccount
name: default
namespace: openshift-cluster-api
namespace: openshift-machine-api
roleRef:
kind: ClusterRole
name: cluster-admin
Expand Down