Skip to content

Commit

Permalink
Remove unnecessary check
Browse files Browse the repository at this point in the history
  • Loading branch information
willie-yao committed Nov 27, 2023
1 parent af2bf9a commit 1c5b782
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions azure/services/bastionhosts/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1c5b782

Please sign in to comment.