diff options
author | HÃ¥kon Hallingstad <hakon.hallingstad@gmail.com> | 2023-05-10 13:11:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-10 13:11:29 +0200 |
commit | 2d11f545108d46dc6ae2aff098892f5462f2cefc (patch) | |
tree | 6d9b098b07da7bc66dc686fe8fd9c7c5b2dd0fe4 | |
parent | f6eb575c6e3006f9fdcb5218cc4f6d67c515bc3c (diff) | |
parent | 2fc11f0956648f3499fc356b5273598e7c6fcb1d (diff) |
Merge pull request #27049 from vespa-engine/hakonhall/disallow-removing-the-cfg-lb-as-cfg-will-then-replace-it-with-a-tenant-lb
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 */ |