diff --git a/machine/v1/tests/controlplanemachinesets.machine.openshift.io/CPMSMachineNamePrefix.yaml b/machine/v1/tests/controlplanemachinesets.machine.openshift.io/CPMSMachineNamePrefix.yaml index aff24bd6b93..cde8933ea62 100644 --- a/machine/v1/tests/controlplanemachinesets.machine.openshift.io/CPMSMachineNamePrefix.yaml +++ b/machine/v1/tests/controlplanemachinesets.machine.openshift.io/CPMSMachineNamePrefix.yaml @@ -131,4 +131,25 @@ tests: machine.openshift.io/cluster-api-cluster: cluster spec: providerSpec: {} - expectedError: 'Invalid value: "string": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, ''-'' or ''.'', and must start and end with an alphanumeric character.' + expectedError: 'Invalid value: "string": a lowercase RFC 1123 subdomain must consist of lowercase alphanumeric characters, hyphens (''-''), and periods (''.''). Each block, separated by periods, must start and end with an alphanumeric character. Hyphens are not allowed at the start or end of a block, and consecutive periods are not permitted.' + - name: Should reject to create ControlPlaneMachineSet with invalid machineNamePrefix - Consecutive periods are not permitted + initial: | + apiVersion: machine.openshift.io/v1 + kind: ControlPlaneMachineSet + spec: + machineNamePrefix: "control..plane" + 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: {} + expectedError: 'Invalid value: "string": a lowercase RFC 1123 subdomain must consist of lowercase alphanumeric characters, hyphens (''-''), and periods (''.''). Each block, separated by periods, must start and end with an alphanumeric character. Hyphens are not allowed at the start or end of a block, and consecutive periods are not permitted.'