Bug 1777232 - The naming rule of cluster name does not match the rule of GCP
Summary: The naming rule of cluster name does not match the rule of GCP
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 4.3.0
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
: 4.4.0
Assignee: Patrick Dillon
QA Contact: yangyang
URL:
Whiteboard:
Depends On:
Blocks: 1782447
TreeView+ depends on / blocked
 
Reported: 2019-11-27 08:49 UTC by yangyang
Modified: 2020-05-04 11:18 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
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
Clone Of:
: 1782447 (view as bug list)
Environment:
Last Closed: 2020-05-04 11:17:42 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github openshift installer pull 2760 'None' closed Bug 1777232: Add GCP-specific validation of cluster name. 2020-04-24 12:27:36 UTC
Red Hat Product Errata RHBA-2020:0581 None None None 2020-05-04 11:18:08 UTC

Description yangyang 2019-11-27 08:49:38 UTC
Description of problem:

Regex used for cluster name validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'), while regex used for GCP is ([a-z]([-a-z0-9]{0,61}[a-z0-9])?). So cluster name for GCP platform must start with a lower case letter.

Version-Release number of the following components:

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

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: gcp
Cluster Name: 123456

Actual results:
Installation failed due to incorrect cluster name. Please find error message below.

Error: Error creating Image: googleapi: Error 400: Invalid value for field 'resource.name': '123456-67rsh-rhcos-image'. Must be a match of regex '(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)', invalid 

Expected results:
Please modify the regex used by cluster name 

Additional info:

Comment 3 yangyang 2019-12-25 08:40:23 UTC
Verified with payload 4.4.0-0.nightly-2019-12-20-210709.

Steps to verify as below:

Set the cluster name to 123456 and create manifests

./openshift-install create manifests --dir '/home/jenkins/workspace/Launch Environment Flexy/workdir/install-dir'
level=fatal msg="failed to fetch Master Machines: failed to load asset \"Install Config\": invalid \"install-config.yaml\" file: metadata.name: Invalid value: \"123456\": GCP requires cluster name to match regular expression (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)"

Comment 5 errata-xmlrpc 2020-05-04 11:17:42 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


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