From 6d4999f55c76540e7c7221bf0f3b145e079826ef Mon Sep 17 00:00:00 2001 From: esierra-stratio <102975650+esierra-stratio@users.noreply.github.com> Date: Mon, 11 Sep 2023 14:38:38 +0200 Subject: [PATCH] fix: exit with error when subnet doesn't exist (#278) * fix: show error when subnet doesn't exist * group if --------- Co-authored-by: stg <65890694+stg-0@users.noreply.github.com> --- pkg/cluster/internal/create/actions/createworker/azure.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cluster/internal/create/actions/createworker/azure.go b/pkg/cluster/internal/create/actions/createworker/azure.go index 143cbb21c7..69f7c524e7 100644 --- a/pkg/cluster/internal/create/actions/createworker/azure.go +++ b/pkg/cluster/internal/create/actions/createworker/azure.go @@ -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