From e15b6f518ebccc4ef347bdd2aae62d4abafadd96 Mon Sep 17 00:00:00 2001 From: Enxebre Date: Mon, 4 Feb 2019 11:20:05 +0100 Subject: [PATCH 1/2] Drop cluster.k8s.io CRDs and controllers --- ...hine-api-operator_01_images.configmap.yaml | 2 +- ...0_machine-api-operator_02_machine.crd.yaml | 6 +- ...achine-api-operator_03_machineset.crd.yaml | 6 +- ...api-operator_04_machinedeployment.crd.yaml | 6 +- ...0_machine-api-operator_05_cluster.crd.yaml | 6 +- ...hine-api-operator_06_machineclass.crd.yaml | 6 +- ...0_machine-api-operator_08_machine.crd.yaml | 120 ---------------- ...0000_50_machine-api-operator_08_rbac.yaml} | 0 ...0_machine-api-operator_09_deployment.yaml} | 0 ...achine-api-operator_09_machineset.crd.yaml | 131 ------------------ ...api-operator_10_machinedeployment.crd.yaml | 127 ----------------- ...0_machine-api-operator_11_cluster.crd.yaml | 97 ------------- ...hine-api-operator_12_machineclass.crd.yaml | 32 ----- .../clusterapi-manager-cluster-role.yaml | 20 --- .../clusterapi-manager-controllers.yaml | 54 -------- pkg/operator/config.go | 12 +- pkg/operator/config_test.go | 22 +-- pkg/operator/fixtures/images.json | 5 +- pkg/operator/operator.go | 12 -- .../manifests/images.configmap.yaml | 5 +- 20 files changed, 27 insertions(+), 642 deletions(-) delete mode 100644 install/0000_50_machine-api-operator_08_machine.crd.yaml rename install/{0000_50_machine-api-operator_13_rbac.yaml => 0000_50_machine-api-operator_08_rbac.yaml} (100%) rename install/{0000_50_machine-api-operator_14_deployment.yaml => 0000_50_machine-api-operator_09_deployment.yaml} (100%) delete mode 100644 install/0000_50_machine-api-operator_09_machineset.crd.yaml delete mode 100644 install/0000_50_machine-api-operator_10_machinedeployment.crd.yaml delete mode 100644 install/0000_50_machine-api-operator_11_cluster.crd.yaml delete mode 100644 install/0000_50_machine-api-operator_12_machineclass.crd.yaml diff --git a/install/0000_50_machine-api-operator_01_images.configmap.yaml b/install/0000_50_machine-api-operator_01_images.configmap.yaml index 5b69d7573e..743b8a3f3e 100644 --- a/install/0000_50_machine-api-operator_01_images.configmap.yaml +++ b/install/0000_50_machine-api-operator_01_images.configmap.yaml @@ -4,4 +4,4 @@ metadata: name: machine-api-operator-images namespace: openshift-cluster-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", "clusterAPIControllerLibvirtDeprecated": "quay.io/coreos/cluster-api-provider-libvirt:origin-v4.0-2019-01-31-041134", "clusterAPIControllerAWSDeprecated": "quay.io/coreos/cluster-api-provider-aws:origin-v4.0-2019-01-31-041134", "clusterAPIControllerOpenStackDeprecated": "quay.io/coreos/cluster-api-provider-openstack:origin-v4.0-2019-01-31-041134"}' + 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"}' diff --git a/install/0000_50_machine-api-operator_02_machine.crd.yaml b/install/0000_50_machine-api-operator_02_machine.crd.yaml index 2777d79e3c..0489f5adfd 100644 --- a/install/0000_50_machine-api-operator_02_machine.crd.yaml +++ b/install/0000_50_machine-api-operator_02_machine.crd.yaml @@ -4,7 +4,7 @@ metadata: creationTimestamp: null labels: controller-tools.k8s.io: "1.0" - name: machines.cluster.k8s.io + name: machines.machine.openshift.io spec: additionalPrinterColumns: - JSONPath: .status.providerStatus.instanceId @@ -30,7 +30,7 @@ spec: - JSONPath: .metadata.creationTimestamp name: Age type: date - group: cluster.k8s.io + group: machine.openshift.io names: kind: Machine plural: machines @@ -220,7 +220,7 @@ spec: - kubelet type: object type: object - version: v1alpha1 + version: v1beta1 status: acceptedNames: kind: "" diff --git a/install/0000_50_machine-api-operator_03_machineset.crd.yaml b/install/0000_50_machine-api-operator_03_machineset.crd.yaml index 5753b5cef8..5bebdac2b2 100644 --- a/install/0000_50_machine-api-operator_03_machineset.crd.yaml +++ b/install/0000_50_machine-api-operator_03_machineset.crd.yaml @@ -4,9 +4,9 @@ metadata: creationTimestamp: null labels: controller-tools.k8s.io: "1.0" - name: machinesets.cluster.k8s.io + name: machinesets.machine.openshift.io spec: - group: cluster.k8s.io + group: machine.openshift.io names: kind: MachineSet plural: machinesets @@ -183,7 +183,7 @@ spec: required: - replicas type: object - version: v1alpha1 + version: v1beta1 additionalPrinterColumns: - JSONPath: .spec.replicas description: Desired Replicas diff --git a/install/0000_50_machine-api-operator_04_machinedeployment.crd.yaml b/install/0000_50_machine-api-operator_04_machinedeployment.crd.yaml index aefa16ebdb..83b3aa648f 100644 --- a/install/0000_50_machine-api-operator_04_machinedeployment.crd.yaml +++ b/install/0000_50_machine-api-operator_04_machinedeployment.crd.yaml @@ -4,9 +4,9 @@ metadata: creationTimestamp: null labels: controller-tools.k8s.io: "1.0" - name: machinedeployments.cluster.k8s.io + name: machinedeployments.machine.openshift.io spec: - group: cluster.k8s.io + group: machine.openshift.io names: kind: MachineDeployment plural: machinedeployments @@ -230,7 +230,7 @@ spec: format: int32 type: integer type: object - version: v1alpha1 + version: v1beta1 status: acceptedNames: kind: "" diff --git a/install/0000_50_machine-api-operator_05_cluster.crd.yaml b/install/0000_50_machine-api-operator_05_cluster.crd.yaml index 7cc433614a..0bd71b8b7c 100644 --- a/install/0000_50_machine-api-operator_05_cluster.crd.yaml +++ b/install/0000_50_machine-api-operator_05_cluster.crd.yaml @@ -3,9 +3,9 @@ kind: CustomResourceDefinition metadata: labels: controller-tools.k8s.io: "1.0" - name: clusters.cluster.k8s.io + name: clusters.machine.openshift.io spec: - group: cluster.k8s.io + group: machine.openshift.io names: kind: Cluster plural: clusters @@ -88,7 +88,7 @@ spec: providerStatus: type: object type: object - version: v1alpha1 + version: v1beta1 status: acceptedNames: kind: "" diff --git a/install/0000_50_machine-api-operator_06_machineclass.crd.yaml b/install/0000_50_machine-api-operator_06_machineclass.crd.yaml index 149b5ab36a..e7fd7972b8 100644 --- a/install/0000_50_machine-api-operator_06_machineclass.crd.yaml +++ b/install/0000_50_machine-api-operator_06_machineclass.crd.yaml @@ -4,9 +4,9 @@ metadata: creationTimestamp: null labels: controller-tools.k8s.io: "1.0" - name: machineclasses.cluster.k8s.io + name: machineclasses.machine.openshift.io spec: - group: cluster.k8s.io + group: machine.openshift.io names: kind: MachineClass plural: machineclasses @@ -31,7 +31,7 @@ spec: type: object required: - providerSpec - version: v1alpha1 + version: v1beta1 status: acceptedNames: kind: "" diff --git a/install/0000_50_machine-api-operator_08_machine.crd.yaml b/install/0000_50_machine-api-operator_08_machine.crd.yaml deleted file mode 100644 index 54fd350cd1..0000000000 --- a/install/0000_50_machine-api-operator_08_machine.crd.yaml +++ /dev/null @@ -1,120 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - labels: - controller-tools.k8s.io: "1.0" - name: machines.machine.openshift.io -spec: - additionalPrinterColumns: - - JSONPath: .status.providerStatus.instanceId - name: Instance - description: Instance ID of machine created in AWS - type: string - - JSONPath: .status.providerStatus.instanceState - name: State - description: State of the AWS instance - type: string - - JSONPath: .spec.providerSpec.value.instanceType - name: Type - description: Type of instance - type: string - - JSONPath: .spec.providerSpec.value.placement.region - name: Region - description: Region associated with machine - type: string - - JSONPath: .spec.providerSpec.value.placement.availabilityZone - name: Zone - description: Zone associated with machine - type: string - - JSONPath: .metadata.creationTimestamp - name: Age - type: date - group: machine.openshift.io - names: - kind: Machine - plural: machines - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - type: object - properties: - configSource: - type: object - metadata: - type: object - providerSpec: - properties: - value: - type: object - valueFrom: - properties: - machineClass: - properties: - provider: - type: string - type: object - type: object - type: object - taints: - items: - type: object - type: array - versions: - properties: - controlPlane: - type: string - kubelet: - type: string - required: - - kubelet - type: object - required: - - providerSpec - status: - properties: - addresses: - items: - type: object - type: array - conditions: - items: - type: object - type: array - errorMessage: - type: string - errorReason: - type: string - lastUpdated: - format: date-time - type: string - nodeRef: - type: object - providerStatus: - type: object - versions: - properties: - controlPlane: - type: string - kubelet: - type: string - required: - - kubelet - type: object - type: object - version: v1beta1 -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/install/0000_50_machine-api-operator_13_rbac.yaml b/install/0000_50_machine-api-operator_08_rbac.yaml similarity index 100% rename from install/0000_50_machine-api-operator_13_rbac.yaml rename to install/0000_50_machine-api-operator_08_rbac.yaml diff --git a/install/0000_50_machine-api-operator_14_deployment.yaml b/install/0000_50_machine-api-operator_09_deployment.yaml similarity index 100% rename from install/0000_50_machine-api-operator_14_deployment.yaml rename to install/0000_50_machine-api-operator_09_deployment.yaml diff --git a/install/0000_50_machine-api-operator_09_machineset.crd.yaml b/install/0000_50_machine-api-operator_09_machineset.crd.yaml deleted file mode 100644 index ff12050c03..0000000000 --- a/install/0000_50_machine-api-operator_09_machineset.crd.yaml +++ /dev/null @@ -1,131 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - labels: - controller-tools.k8s.io: "1.0" - name: machinesets.machine.openshift.io -spec: - group: machine.openshift.io - names: - kind: MachineSet - plural: machinesets - scope: Namespaced - subresources: - scale: - labelSelectorPath: .status.labelSelector - specReplicasPath: .spec.replicas - statusReplicasPath: .status.replicas - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - type: object - properties: - minReadySeconds: - format: int32 - type: integer - replicas: - format: int32 - type: integer - selector: - type: object - template: - type: object - properties: - metadata: - type: object - spec: - type: object - properties: - configSource: - type: object - metadata: - type: object - providerSpec: - properties: - value: - type: object - valueFrom: - properties: - machineClass: - properties: - provider: - type: string - type: object - type: object - type: object - taints: - items: - type: object - type: array - versions: - properties: - controlPlane: - type: string - kubelet: - type: string - required: - - kubelet - type: object - required: - - providerSpec - required: - - selector - status: - properties: - availableReplicas: - format: int32 - type: integer - errorMessage: - type: string - errorReason: - type: string - fullyLabeledReplicas: - format: int32 - type: integer - observedGeneration: - format: int64 - type: integer - readyReplicas: - format: int32 - type: integer - replicas: - format: int32 - type: integer - required: - - replicas - type: object - version: v1beta1 - additionalPrinterColumns: - - JSONPath: .spec.replicas - description: Desired Replicas - name: Desired - type: integer - - JSONPath: .status.replicas - description: Current Replicas - name: Current - type: integer - - JSONPath: .status.readyReplicas - description: Ready Replicas - name: Ready - type: integer - - JSONPath: .status.availableReplicas - name: Available - description: Observed number of available replicas - type: string - - JSONPath: .metadata.creationTimestamp - name: Age - type: date -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/install/0000_50_machine-api-operator_10_machinedeployment.crd.yaml b/install/0000_50_machine-api-operator_10_machinedeployment.crd.yaml deleted file mode 100644 index 6f54dbec23..0000000000 --- a/install/0000_50_machine-api-operator_10_machinedeployment.crd.yaml +++ /dev/null @@ -1,127 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - labels: - controller-tools.k8s.io: "1.0" - name: machinedeployments.machine.openshift.io -spec: - group: machine.openshift.io - names: - kind: MachineDeployment - plural: machinedeployments - scope: Namespaced - subresources: - scale: - labelSelectorPath: .status.labelSelector - specReplicasPath: .spec.replicas - statusReplicasPath: .status.replicas - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - type: object - properties: - minReadySeconds: - format: int32 - type: integer - paused: - type: boolean - progressDeadlineSeconds: - format: int32 - type: integer - replicas: - format: int32 - type: integer - revisionHistoryLimit: - format: int32 - type: integer - selector: - type: object - strategy: - properties: - rollingUpdate: - properties: - maxSurge: {} - maxUnavailable: {} - type: object - type: - type: string - type: object - template: - type: object - properties: - metadata: - type: object - spec: - type: object - properties: - configSource: - type: object - metadata: - type: object - providerSpec: - properties: - value: - type: object - valueFrom: - properties: - machineClass: - properties: - provider: - type: string - type: object - type: object - type: object - taints: - items: - type: object - type: array - versions: - properties: - controlPlane: - type: string - kubelet: - type: string - required: - - kubelet - type: object - required: - - providerSpec - required: - - selector - - template - status: - properties: - availableReplicas: - format: int32 - type: integer - observedGeneration: - format: int64 - type: integer - readyReplicas: - format: int32 - type: integer - replicas: - format: int32 - type: integer - unavailableReplicas: - format: int32 - type: integer - updatedReplicas: - format: int32 - type: integer - type: object - version: v1beta1 -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/install/0000_50_machine-api-operator_11_cluster.crd.yaml b/install/0000_50_machine-api-operator_11_cluster.crd.yaml deleted file mode 100644 index 0bd71b8b7c..0000000000 --- a/install/0000_50_machine-api-operator_11_cluster.crd.yaml +++ /dev/null @@ -1,97 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - labels: - controller-tools.k8s.io: "1.0" - name: clusters.machine.openshift.io -spec: - group: machine.openshift.io - names: - kind: Cluster - plural: clusters - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - clusterNetwork: - properties: - pods: - properties: - cidrBlocks: - items: - type: string - type: array - required: - - cidrBlocks - type: object - serviceDomain: - type: string - services: - properties: - cidrBlocks: - items: - type: string - type: array - required: - - cidrBlocks - type: object - required: - - services - - pods - - serviceDomain - type: object - providerSpec: - properties: - value: - type: object - valueFrom: - properties: - machineClass: - properties: - provider: - type: string - type: object - type: object - type: object - required: - - clusterNetwork - type: object - status: - properties: - apiEndpoints: - items: - properties: - host: - type: string - port: - format: int64 - type: integer - required: - - host - - port - type: object - type: array - errorMessage: - type: string - errorReason: - type: string - providerStatus: - type: object - type: object - version: v1beta1 -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/install/0000_50_machine-api-operator_12_machineclass.crd.yaml b/install/0000_50_machine-api-operator_12_machineclass.crd.yaml deleted file mode 100644 index a328aede92..0000000000 --- a/install/0000_50_machine-api-operator_12_machineclass.crd.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - labels: - controller-tools.k8s.io: "1.0" - name: machineclasses.machine.openshift.io -spec: - group: machine.openshift.io - names: - kind: MachineClass - plural: machineclasses - scope: Namespaced - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - providerSpec: - type: object - required: - - providerSpec - version: v1beta1 -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/owned-manifests/clusterapi-manager-cluster-role.yaml b/owned-manifests/clusterapi-manager-cluster-role.yaml index 00da933fb6..ad919d3fb3 100644 --- a/owned-manifests/clusterapi-manager-cluster-role.yaml +++ b/owned-manifests/clusterapi-manager-cluster-role.yaml @@ -4,26 +4,6 @@ metadata: creationTimestamp: null name: cluster-api-manager-role rules: -- apiGroups: - - cluster.k8s.io - resources: - - clusters - - clusters/status - - machines - - machines/status - - machinesets - - machinesets/status - - machinedeployments - - machinedeployments/status - verbs: - - get - - list - - watch - - create - - update - - patch - - delete - - apiGroups: - machine.openshift.io resources: diff --git a/owned-manifests/clusterapi-manager-controllers.yaml b/owned-manifests/clusterapi-manager-controllers.yaml index 95ee3f48da..4ca6d900c1 100644 --- a/owned-manifests/clusterapi-manager-controllers.yaml +++ b/owned-manifests/clusterapi-manager-controllers.yaml @@ -61,46 +61,6 @@ spec: args: - --logtostderr=true - --v=3 - - name: controller-manager-deprecated - image: {{ .Controllers.ProviderDeprecated }} - command: - - "./manager" - args: - - --logtostderr=true - - --v=3 - resources: - requests: - cpu: 100m - memory: 20Mi - limits: - cpu: 100m - memory: 30Mi - - name: machine-controller-deprecated - image: {{ .Controllers.ProviderDeprecated }} - env: - - name: NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - command: - - /machine-controller-manager - args: - - --logtostderr=true - - --v=3 - - name: nodelink-controller-deprecated - image: quay.io/coreos/machine-api-operator:origin-v4.0-2019-01-31-041134 - command: - - /nodelink-controller - args: - - --logtostderr=true - - --v=3 - resources: - requests: - cpu: 100m - memory: 20Mi - limits: - cpu: 100m - memory: 30Mi - name: nodelink-controller image: {{ .Controllers.NodeLink }} command: @@ -115,20 +75,6 @@ spec: limits: cpu: 100m memory: 30Mi - - name: machine-healthcheck-deprecated - image: quay.io/coreos/machine-api-operator:origin-v4.0-2019-01-31-041134 - command: - - /machine-healthcheck - args: - - --logtostderr=true - - --v=3 - resources: - requests: - cpu: 100m - memory: 20Mi - limits: - cpu: 100m - memory: 30Mi - name: machine-healthcheck image: {{ .Controllers.MachineHealthCheck }} command: diff --git a/pkg/operator/config.go b/pkg/operator/config.go index ae7d095cbf..da456ce11a 100644 --- a/pkg/operator/config.go +++ b/pkg/operator/config.go @@ -41,20 +41,16 @@ type OperatorConfig struct { type Controllers struct { Provider string - ProviderDeprecated string NodeLink string MachineHealthCheck string } // Images allows build systems to inject images for MAO components type Images struct { - MachineAPIOperator string `json:"machineAPIOperator"` - ClusterAPIControllerAWS string `json:"clusterAPIControllerAWS"` - ClusterAPIControllerAWSDeprecated string `json:"clusterAPIControllerAWSDeprecated"` - ClusterAPIControllerOpenStack string `json:"clusterAPIControllerOpenStack"` - ClusterAPIControllerLibvirt string `json:"clusterAPIControllerLibvirt"` - ClusterAPIControllerLibvirtDeprecated string `json:"clusterAPIControllerLibvirtDeprecated"` - ClusterAPIControllerOpenStackDeprecated string `json:"clusterAPIControllerOpenStackDeprecated"` + MachineAPIOperator string `json:"machineAPIOperator"` + ClusterAPIControllerAWS string `json:"clusterAPIControllerAWS"` + ClusterAPIControllerOpenStack string `json:"clusterAPIControllerOpenStack"` + ClusterAPIControllerLibvirt string `json:"clusterAPIControllerLibvirt"` } // InstallConfig contains the mao relevant config coming from the install config, i.e provider diff --git a/pkg/operator/config_test.go b/pkg/operator/config_test.go index 994a21a3ff..cfa1c9aa8d 100644 --- a/pkg/operator/config_test.go +++ b/pkg/operator/config_test.go @@ -7,14 +7,11 @@ import ( ) var ( - imagesJSONFile = "fixtures/images.json" - expectedAWSImage = "docker.io/openshift/origin-aws-machine-controllers:v4.0.0" - expectedLibvirtImage = "docker.io/openshift/origin-libvirt-machine-controllers:v4.0.0" - expectedOpenstackImage = "docker.io/openshift/origin-openstack-machine-controllers:v4.0.0" - expectedMachineAPIOperatorImage = "docker.io/openshift/origin-machine-api-operator:v4.0.0" - expectedAWSImageDeprecated = "quay.io/coreos/cluster-api-provider-aws:origin-v4.0-2019-01-31-041134" - expectedLibvirtImageDeprecated = "quay.io/coreos/cluster-api-provider-libvirt:origin-v4.0-2019-01-31-041134" - expectedOpenstackImageDeprecated = "quay.io/coreos/cluster-api-provider-openstack:origin-v4.0-2019-01-31-041134" + imagesJSONFile = "fixtures/images.json" + expectedAWSImage = "docker.io/openshift/origin-aws-machine-controllers:v4.0.0" + expectedLibvirtImage = "docker.io/openshift/origin-libvirt-machine-controllers:v4.0.0" + expectedOpenstackImage = "docker.io/openshift/origin-openstack-machine-controllers:v4.0.0" + expectedMachineAPIOperatorImage = "docker.io/openshift/origin-machine-api-operator:v4.0.0" ) func TestInstallConfigFromClusterConfig(t *testing.T) { @@ -137,15 +134,6 @@ func TestGetImagesFromJSONFile(t *testing.T) { if img.ClusterAPIControllerOpenStack != expectedOpenstackImage { t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedOpenstackImage, img.ClusterAPIControllerOpenStack) } - if img.ClusterAPIControllerAWSDeprecated != expectedAWSImageDeprecated { - t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedAWSImageDeprecated, img.ClusterAPIControllerAWSDeprecated) - } - if img.ClusterAPIControllerLibvirtDeprecated != expectedLibvirtImageDeprecated { - t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedLibvirtImageDeprecated, img.ClusterAPIControllerLibvirtDeprecated) - } - if img.ClusterAPIControllerOpenStackDeprecated != expectedOpenstackImageDeprecated { - t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedOpenstackImageDeprecated, img.ClusterAPIControllerOpenStackDeprecated) - } } func TestGetProviderControllerFromImages(t *testing.T) { diff --git a/pkg/operator/fixtures/images.json b/pkg/operator/fixtures/images.json index 89f51401e9..40c303dc99 100644 --- a/pkg/operator/fixtures/images.json +++ b/pkg/operator/fixtures/images.json @@ -2,8 +2,5 @@ "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", - "machineAPIOperator": "docker.io/openshift/origin-machine-api-operator:v4.0.0", - "clusterAPIControllerLibvirtDeprecated": "quay.io/coreos/cluster-api-provider-libvirt:origin-v4.0-2019-01-31-041134", - "clusterAPIControllerAWSDeprecated": "quay.io/coreos/cluster-api-provider-aws:origin-v4.0-2019-01-31-041134", - "clusterAPIControllerOpenStackDeprecated": "quay.io/coreos/cluster-api-provider-openstack:origin-v4.0-2019-01-31-041134" + "machineAPIOperator": "docker.io/openshift/origin-machine-api-operator:v4.0.0" } diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go index b51da522b9..ea58191b1d 100644 --- a/pkg/operator/operator.go +++ b/pkg/operator/operator.go @@ -210,22 +210,10 @@ func (optr *Operator) maoConfigFromInstallConfig() (*OperatorConfig, error) { return nil, err } - // TODO: Remove once we transition over machine.openshift.io group - var providerDreprecatedControllerImage string - switch provider { - case AWSProvider: - providerDreprecatedControllerImage = images.ClusterAPIControllerAWSDeprecated - case LibvirtProvider: - providerDreprecatedControllerImage = images.ClusterAPIControllerLibvirtDeprecated - case OpenStackProvider: - providerDreprecatedControllerImage = images.ClusterAPIControllerOpenStackDeprecated - } - return &OperatorConfig{ optr.namespace, Controllers{ providerControllerImage, - providerDreprecatedControllerImage, machineAPIOperatorImage, machineAPIOperatorImage, }, diff --git a/test/integration/manifests/images.configmap.yaml b/test/integration/manifests/images.configmap.yaml index 139cd0072e..cba0a0fa6d 100644 --- a/test/integration/manifests/images.configmap.yaml +++ b/test/integration/manifests/images.configmap.yaml @@ -7,8 +7,5 @@ data: images.json: '{ "clusterAPIControllerAWS": "docker.io/openshift/origin-aws-machine-controllers:v4.0.0", "clusterAPIControllerLibvirt": "docker.io/openshift/origin-libvirt-machine-controllers:v4.0.0", - "machineAPIOperator": "{{ .Image }}", - "clusterAPIControllerLibvirtDeprecated": "quay.io/coreos/cluster-api-provider-libvirt:origin-v4.0-2019-01-31-041134", - "clusterAPIControllerAWSDeprecated": "quay.io/coreos/cluster-api-provider-aws:origin-v4.0-2019-01-31-041134", - "clusterAPIControllerOpenStackDeprecated": "quay.io/coreos/cluster-api-provider-aws:origin-v4.0-2019-01-31-041134" + "machineAPIOperator": "{{ .Image }}" }' \ No newline at end of file From 47734498f40f009c44179042f40a289475fa4f20 Mon Sep 17 00:00:00 2001 From: Enxebre Date: Mon, 4 Feb 2019 11:20:19 +0100 Subject: [PATCH 2/2] Update operator tests to run against machine.openshift.io --- test/e2e/main.go | 4 ++-- test/e2e/operator_expectations.go | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/e2e/main.go b/test/e2e/main.go index 04d74deaad..d2ac029987 100644 --- a/test/e2e/main.go +++ b/test/e2e/main.go @@ -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" @@ -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) } diff --git a/test/e2e/operator_expectations.go b/test/e2e/operator_expectations.go index 99e75ff204..5ec7dd5d8f 100644 --- a/test/e2e/operator_expectations.go +++ b/test/e2e/operator_expectations.go @@ -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" @@ -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 { @@ -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) { @@ -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) @@ -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") @@ -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 { @@ -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) @@ -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 @@ -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