Skip to content

Commit

Permalink
fix: exit with error when subnet doesn't exist (kubernetes-sigs#278)
Browse files Browse the repository at this point in the history
* fix: show error when subnet doesn't exist

* group if

---------

Co-authored-by: stg <[email protected]>
  • Loading branch information
esierra-stratio and stg-0 authored Sep 11, 2023
1 parent 294f117 commit 6d4999f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/cluster/internal/create/actions/createworker/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,9 @@ func (b *AzureBuilder) internalNginx(p ProviderParams, networks commons.Networks
resourceGroup = p.ClusterName
}
for _, s := range networks.Subnets {
publicSubnetID, _ := AzureFilterPublicSubnet(ctx, subnetsClient, resourceGroup, networks.VPCID, s.SubnetId)
if len(publicSubnetID) > 0 {
return false, nil
publicSubnetID, err := AzureFilterPublicSubnet(ctx, subnetsClient, resourceGroup, networks.VPCID, s.SubnetId)
if err != nil || len(publicSubnetID) > 0 {
return false, err
}
}
return true, nil
Expand Down

0 comments on commit 6d4999f

Please sign in to comment.