Use config server for getting log if flag is set
@@ -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();
+ }
+
}
