diff options
author | Harald Musum <musum@verizonmedia.com> | 2020-01-27 12:40:40 +0100 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2020-01-27 12:40:40 +0100 |
commit | 64b6e1bf1954f6cf6aadd0140fa01bbbc7bc04ef (patch) | |
tree | 19e5e8356a2e5d8ebbc514cda207949ff8698093 | |
parent | e2dd2231d24ac8f715e393331385932506402946 (diff) |
Use config server for getting log if flag is set
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java | 18 |
1 files changed, 15 insertions, 3 deletions
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 0c2b6ee1744..6d7980396de 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 @@ -5,8 +5,10 @@ import com.google.common.collect.ImmutableSortedMap; import com.yahoo.component.Version; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.zone.ZoneId; -import com.yahoo.jdisc.Metric; import com.yahoo.vespa.curator.Lock; +import com.yahoo.vespa.flags.BooleanFlag; +import com.yahoo.vespa.flags.FetchVector; +import com.yahoo.vespa.flags.Flags; import com.yahoo.vespa.hosted.controller.Application; import com.yahoo.vespa.hosted.controller.Controller; import com.yahoo.vespa.hosted.controller.Instance; @@ -181,10 +183,15 @@ public class JobController { return run; Optional<URI> testerEndpoint = testerEndpoint(id); - if ( ! testerEndpoint.isPresent()) + if (testerEndpoint.isEmpty()) return run; - List<LogEntry> entries = cloud.getLog(testerEndpoint.get(), run.lastTestLogEntry()); + List<LogEntry> entries; + ZoneId zone = id.type().zone(controller.system()); + if (useConfigServerForTesterAPI(zone)) + entries = cloud.getLog(new DeploymentId(id.application(), zone), run.lastTestLogEntry()); + else + entries = cloud.getLog(testerEndpoint.get(), run.lastTestLogEntry()); if (entries.isEmpty()) return run; @@ -584,4 +591,9 @@ public class JobController { } } + private boolean useConfigServerForTesterAPI(ZoneId zoneId) { + BooleanFlag useConfigServerForTesterAPI = Flags.USE_CONFIG_SERVER_FOR_TESTER_API_CALLS.bindTo(controller.flagSource()); + return useConfigServerForTesterAPI.with(FetchVector.Dimension.ZONE_ID, zoneId.value()).value(); + } + } |