Skip to content

Commit

Permalink
asset: update dns manifest to use Private DNS Zone
Browse files Browse the repository at this point in the history
the ingress-operator can handle the Private DNS Zone since [1]

[1]: openshift/cluster-ingress-operator#300

(cherry picked from commit 7d3119f)
  • Loading branch information
abhinavdahiya authored and jhixson74 committed Dec 16, 2019
1 parent 3c1118f commit eb1884d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions pkg/asset/installconfig/azure/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/manifests/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit eb1884d

Please sign in to comment.