From 1c5b78287019f68f7490ef7220217eefba89a16a Mon Sep 17 00:00:00 2001
From: willie-yao <williamyao@microsoft.com>
Date: Wed, 8 Nov 2023 21:09:58 +0000
Subject: [PATCH] Remove unnecessary check

---
 azure/services/bastionhosts/spec.go | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/azure/services/bastionhosts/spec.go b/azure/services/bastionhosts/spec.go
index 847f1e0b5b3..3c1870c3110 100644
--- a/azure/services/bastionhosts/spec.go
+++ b/azure/services/bastionhosts/spec.go
@@ -75,24 +75,21 @@ func (s *AzureBastionSpec) Parameters(ctx context.Context, existingBastionHost *
 	}
 	bastionHost.Spec.EnableTunneling = ptr.To(s.EnableTunneling)
 	bastionHost.Spec.DnsName = ptr.To(fmt.Sprintf("%s-bastion", strings.ToLower(s.Name)))
-
-	if s.SubnetID != "" && s.PublicIPID != "" {
-		bastionHost.Spec.IpConfigurations = []asonetworkv1.BastionHostIPConfiguration{
-			{
-				Name: ptr.To(bastionHostIPConfigName),
-				Subnet: &asonetworkv1.BastionHostSubResource{
-					Reference: &genruntime.ResourceReference{
-						ARMID: s.SubnetID,
-					},
+	bastionHost.Spec.IpConfigurations = []asonetworkv1.BastionHostIPConfiguration{
+		{
+			Name: ptr.To(bastionHostIPConfigName),
+			Subnet: &asonetworkv1.BastionHostSubResource{
+				Reference: &genruntime.ResourceReference{
+					ARMID: s.SubnetID,
 				},
-				PublicIPAddress: &asonetworkv1.BastionHostSubResource{
-					Reference: &genruntime.ResourceReference{
-						ARMID: s.PublicIPID,
-					},
+			},
+			PublicIPAddress: &asonetworkv1.BastionHostSubResource{
+				Reference: &genruntime.ResourceReference{
+					ARMID: s.PublicIPID,
 				},
-				PrivateIPAllocationMethod: ptr.To(asonetworkv1.IPAllocationMethod_Dynamic),
 			},
-		}
+			PrivateIPAllocationMethod: ptr.To(asonetworkv1.IPAllocationMethod_Dynamic),
+		},
 	}
 
 	return bastionHost, nil