mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-29 10:08:39 -04:00
GCP: Only create debugd loadbalancer when debugCluster is set
This commit is contained in:
parent
d74c7a3769
commit
72d4456b3f
5 changed files with 54 additions and 22 deletions
|
@ -35,7 +35,7 @@ type loadBalancer struct {
|
|||
}
|
||||
|
||||
// CreateLoadBalancers creates all necessary load balancers.
|
||||
func (c *Client) CreateLoadBalancers(ctx context.Context) error {
|
||||
func (c *Client) CreateLoadBalancers(ctx context.Context, isDebugCluster bool) error {
|
||||
if err := c.createIPAddr(ctx); err != nil {
|
||||
return fmt.Errorf("creating load balancer IP address: %w", err)
|
||||
}
|
||||
|
@ -69,13 +69,16 @@ func (c *Client) CreateLoadBalancers(ctx context.Context) error {
|
|||
healthCheck: computepb.HealthCheck_TCP,
|
||||
})
|
||||
|
||||
c.loadbalancers = append(c.loadbalancers, &loadBalancer{
|
||||
name: c.buildResourceName("debugd"),
|
||||
ip: c.loadbalancerIPname,
|
||||
frontendPort: constants.DebugdPort,
|
||||
backendPortName: "debugd",
|
||||
healthCheck: computepb.HealthCheck_TCP,
|
||||
})
|
||||
// Only create when the debug cluster flag is set in the Constellation config
|
||||
if isDebugCluster {
|
||||
c.loadbalancers = append(c.loadbalancers, &loadBalancer{
|
||||
name: c.buildResourceName("debugd"),
|
||||
ip: c.loadbalancerIPname,
|
||||
frontendPort: constants.DebugdPort,
|
||||
backendPortName: "debugd",
|
||||
healthCheck: computepb.HealthCheck_TCP,
|
||||
})
|
||||
}
|
||||
|
||||
// Load balancer creation.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue