Skip to content

Commit c924810

Browse files
authored
skip DNS setup if no zones exist in Azure resource group (#730)
1 parent 72160b6 commit c924810

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

cmd/command/up/up.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ func askAppDomain(project *manifest.ProjectManifest) error {
278278
break
279279
}
280280

281+
// Skip domain setup if no DNS zones exist in the resource group.
282+
if len(dnsZones) == 0 {
283+
break
284+
}
285+
281286
if err := survey.AskOne(
282287
&survey.Select{Message: "Select DNS zone (leave as None to skip):", Options: append([]string{noneOption}, dnsZones...)},
283288
&domain,

pkg/provider/azure.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,15 @@ func AzureDNSZones(ctx context.Context, resourceGroup string) ([]string, error)
484484
return nil, err
485485
}
486486

487+
// If the resource group doesn't exist yet, there are no DNS zones to list.
488+
_, err = clients.Groups.Get(ctx, resourceGroup, nil)
489+
if err != nil {
490+
if isNotFoundResourceGroup(err) {
491+
return nil, nil
492+
}
493+
return nil, err
494+
}
495+
487496
var zones []string
488497
pager := clients.Zones.NewListByResourceGroupPager(resourceGroup, nil)
489498
for pager.More() {

0 commit comments

Comments
 (0)