From 7d3119f8ba3ecefba5b1ec7168de526fdab81b6d Mon Sep 17 00:00:00 2001 From: Abhinav Dahiya Date: Mon, 7 Oct 2019 17:01:06 -0700 Subject: [PATCH] asset: update dns manifest to use Private DNS Zone the ingress-operator can handle the Private DNS Zone since [1] [1]: https://github.com/openshift/cluster-ingress-operator/pull/300 --- pkg/asset/installconfig/azure/dns.go | 10 ++++++++++ pkg/asset/manifests/dns.go | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pkg/asset/installconfig/azure/dns.go b/pkg/asset/installconfig/azure/dns.go index c1a970d3822..50552d6e6a8 100644 --- a/pkg/asset/installconfig/azure/dns.go +++ b/pkg/asset/installconfig/azure/dns.go @@ -62,6 +62,16 @@ func (config DNSConfig) GetDNSZoneID(rgName string, zoneName string) string { zoneName) } +//GetPrivateDNSZoneID returns the Azure Private DNS zone resourceID +//by interpolating the subscriptionID, the resource group and the zone name +func (config DNSConfig) GetPrivateDNSZoneID(rgName string, zoneName string) string { + return fmt.Sprintf( + "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateDnsZones/%s", + config.Session.Credentials.SubscriptionID, + rgName, + zoneName) +} + //GetDNSZone returns a DNS zone selected by survey func (config DNSConfig) GetDNSZone() (*Zone, error) { //call azure api using the session to retrieve available base domain diff --git a/pkg/asset/manifests/dns.go b/pkg/asset/manifests/dns.go index 94b6bfd01ce..1f1d1df62df 100644 --- a/pkg/asset/manifests/dns.go +++ b/pkg/asset/manifests/dns.go @@ -98,7 +98,7 @@ func (d *DNS) Generate(dependencies asset.Parents) error { ID: dnsConfig.GetDNSZoneID(installConfig.Config.Azure.BaseDomainResourceGroupName, installConfig.Config.BaseDomain), } config.Spec.PrivateZone = &configv1.DNSZone{ - ID: dnsConfig.GetDNSZoneID(clusterID.InfraID+"-rg", installConfig.Config.ClusterDomain()), + ID: dnsConfig.GetPrivateDNSZoneID(clusterID.InfraID+"-rg", installConfig.Config.ClusterDomain()), } case gcptypes.Name: zone, err := icgcp.GetPublicZone(context.TODO(), installConfig.Config.Platform.GCP.ProjectID, installConfig.Config.BaseDomain)