diff options
author | Martin Polden <mpolden@mpolden.no> | 2021-01-28 13:13:39 +0100 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2021-01-28 13:31:03 +0100 |
commit | 42baf1e8d829b093c814a083db6e19cf5510dec1 (patch) | |
tree | 95bb3d2483e459a415324fa68be2973dde3de56c /controller-server | |
parent | 3854854f6dcd0ee60b7a0b97bcc0596d60bd81c1 (diff) |
Use cluster in upstream name
Diffstat (limited to 'controller-server')
3 files changed, 7 insertions, 6 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/Endpoint.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/Endpoint.java index 341bf7de9d6..cc1a0a455c4 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/Endpoint.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/Endpoint.java @@ -136,7 +136,7 @@ public class Endpoint { public String upstreamIdOf(DeploymentId deployment) { if (scope != Scope.global) throw new IllegalArgumentException("Scope " + scope + " does not have upstream name"); if (!routingMethod.isShared()) throw new IllegalArgumentException("Routing method " + routingMethod + " does not have upstream name"); - return upstreamIdOf(name(), deployment.applicationId(), deployment.zoneId()); + return upstreamIdOf(cluster.value(), deployment.applicationId(), deployment.zoneId()); } @Override diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/EndpointTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/EndpointTest.java index eb97fa0725c..2d81d7304a1 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/EndpointTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/EndpointTest.java @@ -10,6 +10,7 @@ import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId; import com.yahoo.vespa.hosted.controller.application.Endpoint.Port; import org.junit.Test; +import java.util.List; import java.util.Map; import static org.junit.Assert.assertEquals; @@ -271,16 +272,16 @@ public class EndpointTest { // With non-default cluster "c1.a1.t1.us-north-1.prod", - Endpoint.of(app1).target(EndpointId.of("c1")).on(Port.tls(4443)).in(SystemName.main) + Endpoint.of(app1).target(EndpointId.of("ignored1"), ClusterSpec.Id.from("c1"), List.of(zone)).on(Port.tls(4443)).in(SystemName.main) ); var tests2 = Map.of( - // With non-default instance + // With non-default instance and default cluster "i2.a2.t2.us-north-1.prod", - Endpoint.of(app2).target(EndpointId.defaultId()).on(Port.tls(4443)).in(SystemName.main), + Endpoint.of(app2).target(EndpointId.defaultId(), ClusterSpec.Id.from("default"), List.of(zone)).on(Port.tls(4443)).in(SystemName.main), // With non-default instance and cluster "c2.i2.a2.t2.us-north-1.prod", - Endpoint.of(app2).target(EndpointId.of("c2")).on(Port.tls(4443)).in(SystemName.main) + Endpoint.of(app2).target(EndpointId.of("ignored2"), ClusterSpec.Id.from("c2"), List.of(zone)).on(Port.tls(4443)).in(SystemName.main) ); tests1.forEach((expected, endpoint) -> assertEquals(expected, endpoint.upstreamIdOf(new DeploymentId(app1, zone)))); tests2.forEach((expected, endpoint) -> assertEquals(expected, endpoint.upstreamIdOf(new DeploymentId(app2, zone)))); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/global-rotation-get.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/global-rotation-get.json index f7c512842fd..934e0cf43b9 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/global-rotation-get.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/global-rotation-get.json @@ -1,6 +1,6 @@ { "globalrotationoverride": [ - "instance1.application1.tenant1.us-west-1.prod", + "foo.instance1.application1.tenant1.us-west-1.prod", { "status": "in", "reason": "", |