Azure: Only create debugd loadbalancer when debugCluster is set

This commit is contained in:
Nils Hanke 2022-09-05 18:14:58 +02:00 committed by Nils Hanke
parent 1a4b4f564a
commit d74c7a3769
7 changed files with 109 additions and 40 deletions

View file

@ -32,7 +32,7 @@ type azureclient interface {
GetState() state.ConstellationState
SetState(state.ConstellationState)
CreateApplicationInsight(ctx context.Context) error
CreateExternalLoadBalancer(ctx context.Context) error
CreateExternalLoadBalancer(ctx context.Context, isDebugCluster bool) error
CreateVirtualNetwork(ctx context.Context) error
CreateSecurityGroup(ctx context.Context, input azurecl.NetworkSecurityGroupInput) error
CreateInstances(ctx context.Context, input azurecl.CreateInstancesInput) error

View file

@ -90,7 +90,7 @@ func (c *fakeAzureClient) CreateVirtualNetwork(ctx context.Context) error {
return nil
}
func (c *fakeAzureClient) CreateExternalLoadBalancer(ctx context.Context) error {
func (c *fakeAzureClient) CreateExternalLoadBalancer(ctx context.Context, isDebugCluster bool) error {
c.loadBalancerName = "loadBalancer"
return nil
}
@ -158,7 +158,7 @@ func (c *stubAzureClient) GetState() state.ConstellationState {
func (c *stubAzureClient) SetState(state.ConstellationState) {
}
func (c *stubAzureClient) CreateExternalLoadBalancer(ctx context.Context) error {
func (c *stubAzureClient) CreateExternalLoadBalancer(ctx context.Context, isDebugCluster bool) error {
return c.createLoadBalancerErr
}

View file

@ -164,7 +164,7 @@ func (c *Creator) createAzure(ctx context.Context, cl azureclient, config *confi
if err := cl.CreateApplicationInsight(ctx); err != nil {
return state.ConstellationState{}, err
}
if err := cl.CreateExternalLoadBalancer(ctx); err != nil {
if err := cl.CreateExternalLoadBalancer(ctx, config.IsDebugCluster()); err != nil {
return state.ConstellationState{}, err
}
if err := cl.CreateVirtualNetwork(ctx); err != nil {