Bug 1784322 - Subdomain validation does not match Azure domain rule
Summary: Subdomain validation does not match Azure domain rule
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 4.3.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.4.0
Assignee: Patrick Dillon
QA Contact: Yang Yang
Depends On:
TreeView+ depends on / blocked
Reported: 2019-12-17 08:54 UTC by Yang Yang
Modified: 2020-05-04 11:20 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: installer displayed wrong validation rule in message which said beginning with a number was ok Consequence: specifying cluster name beginning with number would fail even though message says it was ok Fix: fix the displayed message to display proper rule Result: message is consistent with validation check
Clone Of:
Last Closed: 2020-05-04 11:20:19 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github openshift installer pull 2961 0 None closed Bug 1784322: Added Azure validation for cluster names 2020-04-24 12:27:37 UTC
Red Hat Product Errata RHBA-2020:0581 0 None None None 2020-05-04 11:20:43 UTC

Description Yang Yang 2019-12-17 08:54:34 UTC
Description of problem:

Installer uses [a-z0-9]([-a-z0-9]*[a-z0-9]) as dns label, while Azure expects dns label ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. Please refer to the following code

110 const dns1123LabelFmt string = "[a-z0-9]([-a-z0-9]*[a-z0-9])?" 
"vendor/k8s.io/apimachinery/pkg/util/validation/validation.go" 416 lines --23%-- 

Version-Release number of the following components:

# openshift-install version 
openshift-install v4.3.0 
built from commit f2b451a210550607be0526bb5d34420881aaa417 
release image registry.svc.ci.openshift.org/ocp/release@sha256:a768a78eb6a93157eb8277dde2dfd63a734d6ca744b53222048d03e3

How reproducible:

Steps to Reproduce:
1. Install a cluster by issuing the cli, and enter 123456 in the Cluster Name field

openshift-install create cluster --dir=test --log-level=debug
Platform: Azure
Cluster Name: 123456

Actual results:

level=error msg="Error: Error Creating/Updating Public IP \"123456-fdbzs-pip\" (Resource Group \"123456-fdbzs-rg\"): network.PublicIPAddressesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code=\"InvalidDomainNameLabel\" Message=\"The domain name label 123456-fdbzs is invalid. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\"

Expected results:

Prompt error in the config file validation stage. Please add subdomain validation dedicated for Azure

Additional info:
Please attach logs from ansible-playbook with the -vvv flag

Comment 1 Stephen Cuppett 2019-12-17 12:19:38 UTC
Setting target release to 4.4 to perform investigation on the active development branch (will be re-set/cloned where fixes & backports, if any, are required).

Comment 2 Abhinav Dahiya 2019-12-17 23:47:56 UTC
Looks similar to https://bugzilla.redhat.com/show_bug.cgi?id=1777232

Comment 4 Yang Yang 2020-02-07 07:01:41 UTC
Verified with 4.4.0-0.nightly-2020-02-07-012035

Installing a cluster on Azure using 123456 as cluster name and got the below error

level=fatal msg="failed to fetch Terraform Variables: failed to load asset \"Install Config\": invalid \"install-config.yaml\" file: metadata.name: Invalid value: \"123456\": Azure requires cluster name to match regular expression [a-z][a-z0-9-]{1,61}[a-z0-9]"

Cluster name validation is as expected hence moving it to verified state.

Comment 6 errata-xmlrpc 2020-05-04 11:20:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.