summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2020-01-27 14:57:00 +0100
committerGitHub <noreply@github.com>2020-01-27 14:57:00 +0100
commit9270991285b862b9c7cece122ebdb4db28ed75e3 (patch)
treebe94803b1368d855b78f0dd3ad1ca74d33bfecab
parentcb893dc4331304f98ae4b2509d4335552de9739d (diff)
parent64b6e1bf1954f6cf6aadd0140fa01bbbc7bc04ef (diff)
Merge pull request #11962 from vespa-engine/hmusum/use-config-server-for-getLog-if-flag-is-true
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.java18
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();
+ }
+
}