Bug 1814039

Summary: Installer doesn't validates api, dns or wildcard IP information while generating install-config file
Product: OpenShift Container Platform Reporter: Vishal Bhatia <vbhatia>
Component: InstallerAssignee: Roy Golan <rgolan>
Installer sub component: OpenShift on RHV QA Contact: Jan Zmeskal <jzmeskal>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: unspecified CC: dmoessne
Version: 4.4   
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-08-04 18:05:34 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:
Attachments:
Description Flags
Installer logs none

Description Vishal Bhatia 2020-03-16 20:22:14 UTC
Created attachment 1670653 [details]
Installer logs

Description of problem:
IPI installer requires api-server, dns and wildcard domain IPs to be provided. However, its not validating the IP format. Having an extra space in the end causes 

Version-Release number of the following components:
4.4.0-0.nightly-2020-03-15-192859 for linux

Steps to Reproduce:
1. Have an extra space in the end while providing IP address for api-server with ./openshift-install create install-config 
2. Check the created install-config.yaml
3. IP address is listed as string in yaml with quotes and extra space
4. Running installer with install-cluster fails with error 
"failed to fetch dependency of "Terraform Variables": failed to fetch dependency of "Bootstrap Ignition Config": failed to fetch dependency of "Common Manifests": failed to generate asset "Certificate (mcs)": failed to generate signed cert/key pair: error parsing x509 certificate request: x509: cannot parse IP address of length 0"

Actual results:
Incorrect yaml entry for IP address and failed install with above error message

Expected results:
Installer gives an error if invalid IP is entered. 

Additional info:
See attachment

Comment 1 Roy Golan 2020-05-26 09:26:01 UTC
part of latest changes to 4.5 this validation will yeild

[ovirt@vm-10-51 ocp]$ ./openshift-install create ignition-configs --dir test-2
? SSH Public Key /home/ovirt/.ssh/id_rsa.pub
? Platform ovirt
? oVirt cluster green
? oVirt storage domain tlv-netapp
? oVirt network net1
? Internal API virtual IP 10.2.3.2 
? Internal DNS virtual IP 1.1.2.3 
? Ingress virtual IP 4.4.4.4 
? Base Domain foo.com
? Cluster Name fol
? Pull Secret [? for help] 
FATAL failed to fetch Kubeconfig Admin Client: failed to fetch dependency of "Kubeconfig Admin Client": failed to generate asset "Install Config": invalid install config: [platform.ovirt.api_vip: Invalid value: "10.2.3.2 ": "10.2.3.2 " is not a valid IP, platform.ovirt.dns_vip: Invalid value: "1.1.2.3 ": "1.1.2.3 " is not a valid IP, platform.ovirt.ingress_vip: Invalid value: "4.4.4.4 ": "4.4.4.4 " is not a valid IP]

Comment 2 Jan Zmeskal 2020-05-26 09:58:28 UTC
Verified with openshift-install-linux-4.5.0-0.nightly-2020-05-26-051016

Comment 5 errata-xmlrpc 2020-08-04 18:05:34 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 (OpenShift Container Platform 4.5 image release 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:2409