apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this name: "[Stable] ControlPlaneMachineSet" crd: 0000_10_controlplanemachineset.crd.yaml tests: onCreate: - name: Should reject an Azure platform failure domain without any Azure config initial: | apiVersion: machine.openshift.io/v1 kind: ControlPlaneMachineSet spec: selector: matchLabels: machine.openshift.io/cluster-api-machine-role: master machine.openshift.io/cluster-api-machine-type: master template: machineType: machines_v1beta1_machine_openshift_io machines_v1beta1_machine_openshift_io: metadata: labels: machine.openshift.io/cluster-api-machine-role: master machine.openshift.io/cluster-api-machine-type: master machine.openshift.io/cluster-api-cluster: cluster spec: providerSpec: {} failureDomains: platform: Azure expectedError: "spec.template.machines_v1beta1_machine_openshift_io.failureDomains: Invalid value: \"object\": azure configuration is required when platform is Azure" - name: Should reject an Azure configured failure domain without a platform type initial: | apiVersion: machine.openshift.io/v1 kind: ControlPlaneMachineSet spec: selector: matchLabels: machine.openshift.io/cluster-api-machine-role: master machine.openshift.io/cluster-api-machine-type: master template: machineType: machines_v1beta1_machine_openshift_io machines_v1beta1_machine_openshift_io: metadata: labels: machine.openshift.io/cluster-api-machine-role: master machine.openshift.io/cluster-api-machine-type: master machine.openshift.io/cluster-api-cluster: cluster spec: providerSpec: {} failureDomains: azure: - zone: foo expectedError: "spec.template.machines_v1beta1_machine_openshift_io.failureDomains.platform: Required value" - name: Should reject an Azure configured failure domain with the wrong platform type initial: | apiVersion: machine.openshift.io/v1 kind: ControlPlaneMachineSet spec: selector: matchLabels: machine.openshift.io/cluster-api-machine-role: master machine.openshift.io/cluster-api-machine-type: master template: machineType: machines_v1beta1_machine_openshift_io machines_v1beta1_machine_openshift_io: metadata: labels: machine.openshift.io/cluster-api-machine-role: master machine.openshift.io/cluster-api-machine-type: master machine.openshift.io/cluster-api-cluster: cluster spec: providerSpec: {} failureDomains: platform: BareMetal azure: - zone: foo expectedError: "spec.template.machines_v1beta1_machine_openshift_io.failureDomains: Invalid value: \"object\": azure configuration is required when platform is Azure, and forbidden otherwise"