From ed69403157a2d2c78283a61cabe4273ef6f2fd1c Mon Sep 17 00:00:00 2001 From: Abhinav Dahiya Date: Wed, 13 May 2020 21:23:26 -0700 Subject: [PATCH] asset/installconfig/platformprovisioncheck.go: check for api dns record before creating cluster --- pkg/asset/installconfig/platformprovisioncheck.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkg/asset/installconfig/platformprovisioncheck.go b/pkg/asset/installconfig/platformprovisioncheck.go index 96522c92ad5..1639fe81372 100644 --- a/pkg/asset/installconfig/platformprovisioncheck.go +++ b/pkg/asset/installconfig/platformprovisioncheck.go @@ -1,10 +1,12 @@ package installconfig import ( + "context" "fmt" "github.com/openshift/installer/pkg/asset" azconfig "github.com/openshift/installer/pkg/asset/installconfig/azure" + gcpconfig "github.com/openshift/installer/pkg/asset/installconfig/gcp" vsconfig "github.com/openshift/installer/pkg/asset/installconfig/vsphere" "github.com/openshift/installer/pkg/types/aws" "github.com/openshift/installer/pkg/types/azure" @@ -49,7 +51,16 @@ func (a *PlatformProvisionCheck) Generate(dependencies asset.Parents) error { if err != nil { return err } - case aws.Name, baremetal.Name, gcp.Name, libvirt.Name, none.Name, openstack.Name, ovirt.Name: + case gcp.Name: + client, err := gcpconfig.NewClient(context.TODO()) + if err != nil { + return err + } + err = gcpconfig.ValidatePreExitingPublicDNS(client, ic.Config) + if err != nil { + return err + } + case aws.Name, baremetal.Name, libvirt.Name, none.Name, openstack.Name, ovirt.Name: // no special provisioning requirements to check default: err = fmt.Errorf("unknown platform type %q", platform)