Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(azure): make the dns resource group optional #2339

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/azure/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func Create() *cobra.Command {
createCmd.Flags().StringVar(&nodeCountFlag, "node-count", azureDefaults.NodeCount, "the node count for the cluster")
createCmd.Flags().StringVar(&nodeTypeFlag, "node-type", azureDefaults.InstanceSize, "the instance size of the cluster to create")
createCmd.Flags().StringVar(&dnsProviderFlag, "dns-provider", "azure", fmt.Sprintf("the dns provider - one of: %s", supportedDNSProviders))
createCmd.Flags().StringVar(&dnsAzureResourceGroup, "dns-azure-resource-group", "", "the resource group where the Azure DNS Zone is hosted")
createCmd.Flags().StringVar(&dnsAzureResourceGroup, "dns-azure-resource-group", "", "the name of the resource group where the DNS Zone exists. If not set, the first matching zone will be used")
createCmd.Flags().StringVar(&subdomainNameFlag, "subdomain", "", "the subdomain to use for DNS records (Cloudflare)")
createCmd.Flags().StringVar(&domainNameFlag, "domain-name", "", "the Azure/Cloudflare DNS hosted zone name to use for DNS records (i.e. your-domain.com|subdomain.your-domain.com) (required)")
createCmd.MarkFlagRequired("domain-name")
Expand Down
8 changes: 3 additions & 5 deletions cmd/azure/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func createAzure(cmd *cobra.Command, _ []string) error {
return nil
}

err = ValidateProvidedFlags(cliFlags.GitProvider, cliFlags.DNSProvider, cliFlags.DNSAzureRG)
err = ValidateProvidedFlags(cliFlags.GitProvider)
if err != nil {
progress.Error(err.Error())
return nil
Expand Down Expand Up @@ -112,7 +112,7 @@ func createAzure(cmd *cobra.Command, _ []string) error {
return nil
}

func ValidateProvidedFlags(gitProvider, dnsProvider, dnsAzureResourceGroup string) error {
func ValidateProvidedFlags(gitProvider string) error {
progress.AddStep("Validate provided flags")

for _, env := range envvarSecrets {
Expand All @@ -138,9 +138,7 @@ func ValidateProvidedFlags(gitProvider, dnsProvider, dnsAzureResourceGroup strin
}
}

if dnsProvider == "azure" && dnsAzureResourceGroup == "" {
return fmt.Errorf("the resource group for the azure dns zone is required when using azure dns")
}
progress.CompleteStep("Validate provided flags")

return nil
}
Loading