Skip to content

Commit

Permalink
move default IP creation outside of newPublicLoadBalancer method
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-schndr authored and cadenmarchese committed Nov 13, 2023
1 parent 3d7c789 commit 19703fe
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pkg/cluster/deploybaseresources.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ func (m *manager) deployBaseResourceTemplate(ctx context.Context) error {
// Create a public load balancer routing if needed
if m.doc.OpenShiftCluster.Properties.NetworkProfile.OutboundType == api.OutboundTypeLoadbalancer {
m.newPublicLoadBalancer(ctx, &resources)

// If the cluster is public we still want the default public IP address
if m.doc.OpenShiftCluster.Properties.IngressProfiles[0].Visibility == api.VisibilityPublic {
resources = append(resources,
m.networkPublicIPAddress(azureRegion, infraID+"-default-v4"),
)
}
}

if m.doc.OpenShiftCluster.Properties.FeatureProfile.GatewayEnabled {
Expand Down Expand Up @@ -200,12 +207,6 @@ func (m *manager) newPublicLoadBalancer(ctx context.Context, resources *[]*arm.R
*resources = append(*resources,
m.networkPublicLoadBalancer(azureRegion, outboundIPs),
)
// If the cluster is public we still want the default public IP address
if m.doc.OpenShiftCluster.Properties.IngressProfiles[0].Visibility == api.VisibilityPublic {
*resources = append(*resources,
m.networkPublicIPAddress(azureRegion, infraID+"-default-v4"),
)
}
}

// subnetsWithServiceEndpoint returns a unique slice of subnet resource IDs that have the corresponding
Expand Down

0 comments on commit 19703fe

Please sign in to comment.