summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2021-03-23 22:12:56 +0100
committerGitHub <noreply@github.com>2021-03-23 22:12:56 +0100
commit1110d14c9c99f29b60f0551c6cd36d549104227b (patch)
tree499f9064e73386b9652e93ec0f6c40aeb3bec05c
parent52147b9865e0b3871c8309fa014f09c3d4177875 (diff)
parentf197d1572d3fb7f9abb3b7a7a4449bd9481221e7 (diff)
Merge pull request #17139 from vespa-engine/mpolden/configserver-vip
Always use config server VIP in controller
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneRegistry.java6
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java4
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ZoneRegistryMock.java14
3 files changed, 2 insertions, 22 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneRegistry.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneRegistry.java
index 3e5606ac278..76637d10a6e 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneRegistry.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneRegistry.java
@@ -38,15 +38,9 @@ public interface ZoneRegistry {
/** Returns the default region for the given environment, if one is configured */
Optional<RegionName> getDefaultRegion(Environment environment);
- /** Returns the API endpoints of all known config servers in the given zone */
- List<URI> getConfigServerUris(ZoneId zoneId);
-
/** Returns the URI for the config server VIP in the given zone */
URI getConfigServerVipUri(ZoneId zoneId);
- /** Returns all possible API endpoints of all known config servers and config server VIPs in the given zone */
- List<URI> getConfigServerApiUris(ZoneId zoneId);
-
/** Returns the time to live for deployments in the given zone, or empty if this is infinite */
Optional<Duration> getDeploymentTimeToLive(ZoneId zoneId);
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
index 30c30d9c5a9..81183ac9aca 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
@@ -1561,7 +1561,7 @@ public class ApplicationApiHandler extends LoggingRequestHandler {
ZoneId zone = requireZone(environment, region);
ServiceApiResponse response = new ServiceApiResponse(zone,
new ApplicationId.Builder().tenant(tenantName).applicationName(applicationName).instanceName(instanceName).build(),
- controller.zoneRegistry().getConfigServerApiUris(zone),
+ List.of(controller.zoneRegistry().getConfigServerVipUri(zone)),
request.getUri());
response.setResponse(applicationView);
return response;
@@ -1579,7 +1579,7 @@ public class ApplicationApiHandler extends LoggingRequestHandler {
Map<?,?> result = controller.serviceRegistry().configServer().getServiceApiResponse(deploymentId, serviceName, restPath);
ServiceApiResponse response = new ServiceApiResponse(deploymentId.zoneId(),
deploymentId.applicationId(),
- controller.zoneRegistry().getConfigServerApiUris(deploymentId.zoneId()),
+ List.of(controller.zoneRegistry().getConfigServerVipUri(deploymentId.zoneId())),
request.getUri());
response.setResponse(result, serviceName, restPath);
return response;
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ZoneRegistryMock.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ZoneRegistryMock.java
index a03ab8b677a..1d2c743ffba 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ZoneRegistryMock.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ZoneRegistryMock.java
@@ -221,25 +221,11 @@ public class ZoneRegistryMock extends AbstractComponent implements ZoneRegistry
}
@Override
- public List<URI> getConfigServerUris(ZoneId zoneId) {
- return List.of(
- URI.create(String.format("https://cfg1.%s.test:4443/", zoneId.value())),
- URI.create(String.format("https://cfg2.%s.test:4443/", zoneId.value())));
- }
-
- @Override
public URI getConfigServerVipUri(ZoneId zoneId) {
return URI.create(String.format("https://cfg.%s.test.vip:4443/", zoneId.value()));
}
@Override
- public List<URI> getConfigServerApiUris(ZoneId zoneId) {
- return List.of(
- URI.create(String.format("https://cfg.%s.test:4443/", zoneId.value())),
- URI.create(String.format("https://cfg.%s.test.vip:4443/", zoneId.value())));
- }
-
- @Override
public Optional<Duration> getDeploymentTimeToLive(ZoneId zoneId) {
return Optional.ofNullable(deploymentTimeToLive.get(zoneId));
}