Bug 1784322

Summary: Subdomain validation does not match Azure domain rule
Product: OpenShift Container Platform Reporter: Yang Yang <yanyang>
Component: InstallerAssignee: Patrick Dillon <padillon>
Installer sub component: openshift-installer QA Contact: Yang Yang <yanyang>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: jiajliu, scuppett
Version: 4.3.0   
Target Milestone: ---   
Target Release: 4.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-04 11:20:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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:
100%

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.

https://access.redhat.com/errata/RHBA-2020:0581