Bug 2084580

Summary: [4.10] No cluster name sanity validation - cluster name with a dot (".") character
Product: OpenShift Container Platform Reporter: Radek Cegan <rcegan>
Component: InstallerAssignee: Aditya Narayanaswamy <anarayan>
Installer sub component: openshift-installer QA Contact: jima
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: low CC: anarayan, gpei, rdossant, yunjiang
Version: 4.10Keywords: NeedsTestCase
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Components like haproxy failed if the cluster name had a "." in it Consequence: cluster in failing state Fix: Added check for validation for "." Result: user warned ahead of installation
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 11:11:30 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:

Comment 1 Rafael Fonseca 2022-05-19 15:10:03 UTC
Moving assignee to the dev actually doing the work.

Comment 2 jima 2022-05-23 05:22:35 UTC
Reproduced on 4.11.0-0.nightly-2022-05-20-213928:

cluster name is jima.test0523, ipi-on-vsphere installation failed at bootstrap stage.
Check keepalived conf on master node, cluster name is parsed as jima.
[root@jima-test0523-rtwrx-master-1 ~]# cat /etc/keepalived/keepalived.conf 
global_defs {
......
vrrp_instance jima_API {
    state BACKUP
    interface ens192
    virtual_router_id 204
    priority 40
    advert_int 1
......
vrrp_instance jima_INGRESS {
    state BACKUP
    interface ens192
    virtual_router_id 155
    priority 20
    advert_int 1
...

Built image including installer PR https://github.com/openshift/installer/pull/5931 from cluster-bot, verified the fix and passed.
$ ./openshift-install version
./openshift-install 4.11.0-0.ci.test-2022-05-23-031403-ci-ln-9w030tt-latest
built from commit 5ca13c11a5df2c45a5911990cfbdfed76b3046c0
release image registry.build01.ci.openshift.org/ci-ln-9w030tt/release@sha256:87dc94626b82085ce0043e5d3238c0bb268726f2e823a00e1ccac1396a913845
release architecture amd64

Prepare install-config yaml file and set clustername as "jima.test":
$ ./openshift-install create manifests --dir ipi
ERROR failed to fetch Master Machines: failed to load asset "Install Config": failed to create install config: invalid "install-config.yaml" file: metadata.name: Invalid value: "jima.test": cluster name must not contain '.' 

Install cluster in interactive mode, input Cluster Name as "jima.test"
$ ./openshift-install create cluster --dir ipi1
? SSH Public Key /home/jima/.ssh/openshift-qe.pub
? Platform vsphere
? vCenter vcenter.sddc-xxxx.vmwarevmc.com
? Username xxxx
? Password [? for help] **************
INFO Connecting to vCenter vcenter.sddc-xxxx.vmwarevmc.com 
INFO Defaulting to only available datacenter: SDDC-Datacenter 
INFO Defaulting to only available cluster: Cluster-1 
? Default Datastore WorkloadDatastore
? Network qe-segment
? Virtual IP Address for API 192.169.31.2
? Virtual IP Address for Ingress 192.169.31.3
? Base Domain qe.devcluster.openshift.com
X Sorry, your reply was invalid: cluster name must not contain '.'
? Cluster Name

Comment 5 jima 2022-06-07 03:24:00 UTC
since there are some changes after pre-merge verification in Comment 2, verified again on 4.11.0-0.nightly-2022-05-18-171831 and passed.

create install-conifg.yaml file and set clustername as "bug2084580.test"
vSphere:
$ ./openshift-install create manifests --dir ipi/
ERROR failed to fetch Master Machines: failed to load asset "Install Config": failed to create install config: invalid "install-config.yaml" file: metadata.name: Invalid value: "bug2084580.test": cluster name must not contain '.' 

ipi-on-baremetal:
$ ./openshift-install create manifests --dir ipi-baremetal/
ERROR failed to fetch Master Machines: failed to load asset "Install Config": failed to create install config: invalid "install-config.yaml" file: metadata.name: Invalid value: "bug2084580.test": cluster name must not contain '.'

Comment 7 errata-xmlrpc 2022-08-10 11:11:30 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 (Important: OpenShift Container Platform 4.11.0 bug fix and security update), 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/RHSA-2022:5069