Exemplo n.º 1
0
 private static void maybeFillLinks(TaskConfig task) {
   if (task.getTaskLinksSize() == 0) {
     ImmutableMap.Builder<String, String> links = ImmutableMap.builder();
     if (task.getRequestedPorts().contains("health")) {
       links.put("health", "http://%host%:%port:health%");
     }
     if (task.getRequestedPorts().contains("http")) {
       links.put("http", "http://%host%:%port:http%");
     }
     task.setTaskLinks(links.build());
   }
 }
Exemplo n.º 2
0
 private static void maybeFillLinks(TaskConfig task) {
   if (task.getTaskLinksSize() == 0) {
     ImmutableMap.Builder<String, String> links = ImmutableMap.builder();
     for (IResource resource : ResourceManager.getTaskResources(ITaskConfig.build(task), PORTS)) {
       if (resource.getNamedPort().equals("health")) {
         links.put("health", "http://%host%:%port:health%");
       } else if (resource.getNamedPort().equals("http")) {
         links.put("http", "http://%host%:%port:http%");
       }
     }
     task.setTaskLinks(links.build());
   }
 }