summaryrefslogtreecommitdiffstats
path: root/node-repository/src/main
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@yahooinc.com>2023-05-09 16:11:09 +0200
committerHåkon Hallingstad <hakon@yahooinc.com>2023-05-09 16:11:09 +0200
commit2fc11f0956648f3499fc356b5273598e7c6fcb1d (patch)
treeeb26b5f928a77205c495d317452499bc3ac15325 /node-repository/src/main
parentd26ca8bf4c154f42e57eb41e66c8f057e1f4c26f (diff)
Disallow removing the cfg lb as cfg will then replace it with a tenant lb
Diffstat (limited to 'node-repository/src/main')
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/lb/LoadBalancer.java6
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 */