diff options
author | Håkon Hallingstad <hakon@yahooinc.com> | 2023-05-09 16:11:09 +0200 |
---|---|---|
committer | Håkon Hallingstad <hakon@yahooinc.com> | 2023-05-09 16:11:09 +0200 |
commit | 2fc11f0956648f3499fc356b5273598e7c6fcb1d (patch) | |
tree | eb26b5f928a77205c495d317452499bc3ac15325 | |
parent | d26ca8bf4c154f42e57eb41e66c8f057e1f4c26f (diff) |
Disallow removing the cfg lb as cfg will then replace it with a tenant lb
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/lb/LoadBalancer.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/lb/LoadBalancer.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/lb/LoadBalancer.java index ad97ee887c9..c8b8b55b5ea 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/lb/LoadBalancer.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/lb/LoadBalancer.java @@ -2,10 +2,12 @@ package com.yahoo.vespa.hosted.provision.lb; import com.yahoo.vespa.hosted.provision.maintenance.LoadBalancerExpirer; +import com.yahoo.vespa.service.duper.ConfigServerApplication; import java.time.Instant; import java.util.Objects; import java.util.Optional; +import java.util.Set; /** * Represents a load balancer for an application's cluster. This is immutable. @@ -27,6 +29,10 @@ public class LoadBalancer { if (state == State.active && instance.isEmpty()) { throw new IllegalArgumentException("Load balancer instance is required in state " + state); } + if (id.application().equals(new ConfigServerApplication().getApplicationId()) && + Set.of(State.inactive, State.removable).contains(state)) { + throw new IllegalArgumentException("The config server load balancer is managed by Terraform - therefore the state cannot be '" + state + "'"); + } } /** An identifier for this load balancer. The ID is unique inside the zone */ |