summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2019-09-06 10:50:04 +0200
committerMartin Polden <mpolden@mpolden.no>2019-09-09 10:34:17 +0200
commit043ff31751740ab01e944c710a4fc2888195e9c7 (patch)
tree1f79a4c69c5ff83cd8fa0f78b60c6082c2549174 /controller-server
parent6d9688942d19691fbcfca15e7098040da61b0ade (diff)
Move TesterCloud to ServiceRegistry
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Controller.java9
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java4
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java2
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ServiceRegistryMock.java8
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/ControllerContainerTest.java1
5 files changed, 14 insertions, 10 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Controller.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Controller.java
index e3693aabe27..056598b4b0f 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Controller.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Controller.java
@@ -15,7 +15,6 @@ import com.yahoo.vespa.hosted.controller.api.integration.BuildService;
import com.yahoo.vespa.hosted.controller.api.integration.RunDataStore;
import com.yahoo.vespa.hosted.controller.api.integration.ServiceRegistry;
import com.yahoo.vespa.hosted.controller.api.integration.deployment.ApplicationStore;
-import com.yahoo.vespa.hosted.controller.api.integration.deployment.TesterCloud;
import com.yahoo.vespa.hosted.controller.api.integration.maven.MavenRepository;
import com.yahoo.vespa.hosted.controller.api.integration.metrics.MetricsService;
import com.yahoo.vespa.hosted.controller.api.integration.user.Roles;
@@ -87,13 +86,13 @@ public class Controller extends AbstractComponent {
public Controller(CuratorDb curator, RotationsConfig rotationsConfig,
ZoneRegistry zoneRegistry, MetricsService metricsService,
AccessControl accessControl,
- ApplicationStore applicationStore, TesterCloud testerCloud,
+ ApplicationStore applicationStore,
BuildService buildService, RunDataStore runDataStore, FlagSource flagSource,
MavenRepository mavenRepository,
ServiceRegistry serviceRegistry) {
this(curator, rotationsConfig, zoneRegistry,
metricsService,
- Clock.systemUTC(), accessControl, applicationStore, testerCloud,
+ Clock.systemUTC(), accessControl, applicationStore,
buildService, runDataStore, com.yahoo.net.HostName::getLocalhost, flagSource,
mavenRepository, serviceRegistry);
}
@@ -103,7 +102,7 @@ public class Controller extends AbstractComponent {
MetricsService metricsService,
Clock clock,
AccessControl accessControl,
- ApplicationStore applicationStore, TesterCloud testerCloud,
+ ApplicationStore applicationStore,
BuildService buildService, RunDataStore runDataStore, Supplier<String> hostnameSupplier,
FlagSource flagSource, MavenRepository mavenRepository,
ServiceRegistry serviceRegistry) {
@@ -118,7 +117,7 @@ public class Controller extends AbstractComponent {
this.mavenRepository = Objects.requireNonNull(mavenRepository, "MavenRepository cannot be null");
nameServiceForwarder = new NameServiceForwarder(curator);
- jobController = new JobController(this, runDataStore, Objects.requireNonNull(testerCloud));
+ jobController = new JobController(this, runDataStore);
applicationController = new ApplicationController(this, curator, accessControl,
Objects.requireNonNull(rotationsConfig, "RotationsConfig cannot be null"),
Objects.requireNonNull(applicationStore, "ApplicationStore cannot be null"),
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java
index 282e83461ea..11f4916c4ae 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java
@@ -76,11 +76,11 @@ public class JobController {
private AtomicReference<Consumer<Run>> runner = new AtomicReference<>(__ -> { });
- public JobController(Controller controller, RunDataStore runDataStore, TesterCloud testerCloud) {
+ public JobController(Controller controller, RunDataStore runDataStore) {
this.controller = controller;
this.curator = controller.curator();
this.logs = new BufferedLogStore(curator, runDataStore);
- this.cloud = testerCloud;
+ this.cloud = controller.serviceRegistry().testerCloud();
this.badges = new Badges(controller.zoneRegistry().badgeUrl());
}
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java
index 0927fda6b25..00304645edb 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java
@@ -28,7 +28,6 @@ import com.yahoo.vespa.hosted.controller.api.integration.organization.Contact;
import com.yahoo.vespa.hosted.controller.api.integration.stubs.MockBuildService;
import com.yahoo.vespa.hosted.controller.api.integration.stubs.MockMavenRepository;
import com.yahoo.vespa.hosted.controller.api.integration.stubs.MockRunDataStore;
-import com.yahoo.vespa.hosted.controller.api.integration.stubs.MockTesterCloud;
import com.yahoo.vespa.hosted.controller.application.ApplicationPackage;
import com.yahoo.vespa.hosted.controller.athenz.impl.AthenzFacade;
import com.yahoo.vespa.hosted.controller.athenz.mock.AthenzClientFactoryMock;
@@ -321,7 +320,6 @@ public final class ControllerTester {
clock,
new AthenzFacade(new AthenzClientFactoryMock(athensDb)),
applicationStore,
- new MockTesterCloud(),
buildService,
new MockRunDataStore(),
() -> "test-controller",
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 2b34a6a5136..af31ffe73bf 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
@@ -9,6 +9,7 @@ import com.yahoo.vespa.hosted.controller.api.integration.certificates.Applicatio
import com.yahoo.vespa.hosted.controller.api.integration.certificates.ApplicationCertificateProvider;
import com.yahoo.vespa.hosted.controller.api.integration.configserver.ConfigServer;
import com.yahoo.vespa.hosted.controller.api.integration.deployment.ArtifactRepository;
+import com.yahoo.vespa.hosted.controller.api.integration.deployment.TesterCloud;
import com.yahoo.vespa.hosted.controller.api.integration.dns.MemoryNameService;
import com.yahoo.vespa.hosted.controller.api.integration.dns.NameService;
import com.yahoo.vespa.hosted.controller.api.integration.entity.EntityService;
@@ -31,6 +32,7 @@ import com.yahoo.vespa.hosted.controller.api.integration.stubs.DummyOwnershipIss
import com.yahoo.vespa.hosted.controller.api.integration.stubs.LoggingDeploymentIssues;
import com.yahoo.vespa.hosted.controller.api.integration.stubs.MockMailer;
import com.yahoo.vespa.hosted.controller.api.integration.stubs.MockMeteringClient;
+import com.yahoo.vespa.hosted.controller.api.integration.stubs.MockTesterCloud;
import com.yahoo.vespa.hosted.controller.restapi.cost.CostReportConsumerMock;
/**
@@ -57,6 +59,7 @@ public class ServiceRegistryMock extends AbstractComponent implements ServiceReg
private final MockBilling mockBilling = new MockBilling();
private final MockAwsEventFetcher mockAwsEventFetcher = new MockAwsEventFetcher();
private final ArtifactRepositoryMock artifactRepositoryMock = new ArtifactRepositoryMock();
+ private final MockTesterCloud mockTesterCloud = new MockTesterCloud();
@Override
public ConfigServer configServer() {
@@ -134,6 +137,11 @@ public class ServiceRegistryMock extends AbstractComponent implements ServiceReg
}
@Override
+ public TesterCloud testerCloud() {
+ return mockTesterCloud;
+ }
+
+ @Override
public NameService nameService() {
return memoryNameService;
}
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/ControllerContainerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/ControllerContainerTest.java
index bb7658f6f2e..87102d80ef6 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/ControllerContainerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/ControllerContainerTest.java
@@ -74,7 +74,6 @@ public class ControllerContainerTest {
" <component id='com.yahoo.vespa.hosted.controller.maintenance.ControllerMaintenance'/>\n" +
" <component id='com.yahoo.vespa.hosted.controller.maintenance.JobControl'/>\n" +
" <component id='com.yahoo.vespa.hosted.controller.integration.ApplicationStoreMock'/>\n" +
- " <component id='com.yahoo.vespa.hosted.controller.api.integration.stubs.MockTesterCloud'/>\n" +
" <component id='com.yahoo.vespa.hosted.controller.api.integration.stubs.MockMavenRepository'/>\n" +
" <handler id='com.yahoo.vespa.hosted.controller.restapi.deployment.DeploymentApiHandler'>\n" +
" <binding>http://*/deployment/v1/*</binding>\n" +