summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2023-01-27 14:05:57 +0100
committerjonmv <venstad@gmail.com>2023-01-27 14:05:57 +0100
commit117b75ee2f3b4c20ab5982f57cab39e5489598ef (patch)
treef6bcb2c5a5eba24af427f5649f044d53a5222630 /controller-server
parentdc4e5e85caef5d5279649359a16310e825540486 (diff)
Check private endpoints from same-zone config server instead
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java1
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java15
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ServiceRegistryMock.java4
3 files changed, 14 insertions, 6 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
index d7118c4b3c2..c0989f61e36 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
@@ -498,6 +498,7 @@ public class InternalStepRunner implements StepRunner {
DeploymentRoutingContext context = controller.routing().of(deployment);
boolean resolveEndpoints = context.routingMethod() == RoutingMethod.exclusive;
return controller.serviceRegistry().testerCloud().verifyEndpoints(
+ deployment,
endpoints.getOrDefault(zone, List.of())
.stream()
.map(endpoint -> {
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
index e2b421afe61..5704af75cb9 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
@@ -12,6 +12,8 @@ import com.yahoo.config.provision.CloudAccount;
import com.yahoo.config.provision.ClusterResources;
import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.config.provision.DockerImage;
+import com.yahoo.config.provision.EndpointsChecker.Availability;
+import com.yahoo.config.provision.EndpointsChecker.Endpoint;
import com.yahoo.config.provision.Environment;
import com.yahoo.config.provision.HostName;
import com.yahoo.config.provision.NodeResources;
@@ -42,8 +44,10 @@ import com.yahoo.vespa.hosted.controller.api.integration.configserver.QuotaUsage
import com.yahoo.vespa.hosted.controller.api.integration.configserver.ServiceConvergence;
import com.yahoo.vespa.hosted.controller.api.integration.deployment.TestReport;
import com.yahoo.vespa.hosted.controller.api.integration.deployment.TesterCloud;
+import com.yahoo.vespa.hosted.controller.api.integration.dns.NameService;
import com.yahoo.vespa.hosted.controller.api.integration.noderepository.RestartFilter;
import com.yahoo.vespa.hosted.controller.api.integration.secrets.TenantSecretStore;
+import com.yahoo.vespa.hosted.controller.api.integration.stubs.MockTesterCloud;
import com.yahoo.vespa.hosted.controller.application.SystemApplication;
import com.yahoo.vespa.hosted.controller.application.pkg.ApplicationPackage;
@@ -82,6 +86,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
*/
public class ConfigServerMock extends AbstractComponent implements ConfigServer {
+ private final MockTesterCloud mockTesterCloud;
private final Map<DeploymentId, Application> applications = new LinkedHashMap<>();
private final Set<ZoneId> inactiveZones = new HashSet<>();
private final Map<DeploymentId, EndpointStatus> endpoints = new HashMap<>();
@@ -105,9 +110,9 @@ public class ConfigServerMock extends AbstractComponent implements ConfigServer
private Consumer<ApplicationId> prepareException = null;
private Supplier<String> log = () -> "INFO - All good";
- @Inject
- public ConfigServerMock(ZoneRegistryMock zoneRegistry) {
+ public ConfigServerMock(ZoneRegistryMock zoneRegistry, NameService nameService) {
bootstrap(zoneRegistry.zones().all().ids(), SystemApplication.notController());
+ this.mockTesterCloud = new MockTesterCloud(nameService);
}
/** Assigns a reserved tenant node to the given deployment, with initial versions. */
@@ -370,8 +375,10 @@ public class ConfigServerMock extends AbstractComponent implements ConfigServer
public Optional<TestReport> getTestReport(DeploymentId deployment) {
return Optional.ofNullable(testReport.get(deployment));
}
- public void setTestReport(DeploymentId deploymentId, TestReport report) {
- testReport.put(deploymentId, report);
+
+ @Override
+ public Availability verifyEndpoints(DeploymentId deploymentId, List<Endpoint> zoneEndpoints) {
+ return mockTesterCloud.verifyEndpoints(deploymentId, zoneEndpoints); // Wraps the same name service mock, which is updated by test harness.
}
/** Add any of given loadBalancers that do not already exist to the load balancers in zone */
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ServiceRegistryMock.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ServiceRegistryMock.java
index 382a697c4cd..0ba8866c990 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ServiceRegistryMock.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ServiceRegistryMock.java
@@ -100,8 +100,8 @@ public class ServiceRegistryMock extends AbstractComponent implements ServiceReg
public ServiceRegistryMock(SystemName system) {
this.zoneRegistryMock = new ZoneRegistryMock(system);
- this.configServerMock = new ConfigServerMock(zoneRegistryMock);
- this.mockTesterCloud = new MockTesterCloud(nameService());
+ this.configServerMock = new ConfigServerMock(zoneRegistryMock, memoryNameService);
+ this.mockTesterCloud = new MockTesterCloud(memoryNameService);
this.clock.setInstant(Instant.ofEpochSecond(1600000000));
this.controllerVersion = new ControllerVersion(Version.fromString("6.1.0"), "badb01", clock.instant());
}