diff options
author | Martin Polden <mpolden@mpolden.no> | 2019-10-15 14:31:43 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2019-10-15 14:31:43 +0200 |
commit | dee619f27e659d0b18bf870b8ce5bcbac2b54952 (patch) | |
tree | d8af5be75b719d33f5f72bb2165bb73c1e0fef0c | |
parent | 38299f5fc89504356b9237d36e6dc55877d5ef1a (diff) |
Remove obsolete endpoint URL rewrite
3 files changed, 7 insertions, 30 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 786eccc2e24..33d372cffcc 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 @@ -16,11 +16,7 @@ import com.yahoo.vespa.flags.FlagSource; import com.yahoo.vespa.hosted.controller.api.integration.ApplicationIdSource; import com.yahoo.vespa.hosted.controller.api.integration.ServiceRegistry; import com.yahoo.vespa.hosted.controller.api.integration.maven.MavenRepository; -import com.yahoo.vespa.hosted.controller.api.integration.user.Roles; import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneRegistry; -import com.yahoo.vespa.hosted.controller.api.role.ApplicationRole; -import com.yahoo.vespa.hosted.controller.api.role.Role; -import com.yahoo.vespa.hosted.controller.api.role.TenantRole; import com.yahoo.vespa.hosted.controller.auditlog.AuditLogger; import com.yahoo.vespa.hosted.controller.metric.ConfigServerMetrics; import com.yahoo.vespa.hosted.controller.deployment.JobController; @@ -47,7 +43,6 @@ import java.util.function.Predicate; import java.util.function.Supplier; import java.util.logging.Logger; import java.util.stream.Collectors; -import java.util.stream.Stream; /** * API to the controller. This contains the object model of everything the controller cares about, mainly tenants and @@ -115,7 +110,7 @@ public class Controller extends AbstractComponent implements ApplicationIdSource metrics = new ConfigServerMetrics(serviceRegistry.configServer()); nameServiceForwarder = new NameServiceForwarder(curator); - jobController = new JobController(this, flagSource); + jobController = new JobController(this); applicationController = new ApplicationController(this, curator, accessControl, Objects.requireNonNull(rotationsConfig, "RotationsConfig cannot be null"), clock diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java index 7c656da3a67..19597f9d386 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java @@ -348,14 +348,12 @@ public class InternalStepRunner implements StepRunner { return false; for (URI endpoint : endpoints.get(zoneId).values()) { - URI workingEndpoint = controller.jobController().withWorkingSchemeAndPort(endpoint, id); - boolean ready = id.instance().isTester() ? - controller.jobController().cloud().testerReady(workingEndpoint) - : controller.jobController().cloud().ready(workingEndpoint); + controller.jobController().cloud().testerReady(endpoint) + : controller.jobController().cloud().ready(endpoint); if (!ready) { - logger.log("Failed to get 100 consecutive OKs from " + workingEndpoint); + logger.log("Failed to get 100 consecutive OKs from " + endpoint); return false; } } 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 fcc7271e44b..ae57a3a96bc 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 @@ -7,13 +7,9 @@ import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.InstanceName; import com.yahoo.config.provision.zone.ZoneId; import com.yahoo.vespa.curator.Lock; -import com.yahoo.vespa.flags.BooleanFlag; -import com.yahoo.vespa.flags.FetchVector; -import com.yahoo.vespa.flags.FlagSource; -import com.yahoo.vespa.flags.Flags; import com.yahoo.vespa.hosted.controller.Application; -import com.yahoo.vespa.hosted.controller.Instance; import com.yahoo.vespa.hosted.controller.Controller; +import com.yahoo.vespa.hosted.controller.Instance; import com.yahoo.vespa.hosted.controller.LockedApplication; import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId; import com.yahoo.vespa.hosted.controller.api.integration.LogEntry; @@ -81,17 +77,15 @@ public class JobController { private final BufferedLogStore logs; private final TesterCloud cloud; private final Badges badges; - private final BooleanFlag directRoutingUseHttps; private AtomicReference<Consumer<Run>> runner = new AtomicReference<>(__ -> { }); - public JobController(Controller controller, FlagSource flagSource) { + public JobController(Controller controller) { this.controller = controller; this.curator = controller.curator(); this.logs = new BufferedLogStore(curator, controller.serviceRegistry().runDataStore()); this.cloud = controller.serviceRegistry().testerCloud(); this.badges = new Badges(controller.zoneRegistry().badgeUrl()); - this.directRoutingUseHttps = Flags.DIRECT_ROUTING_USE_HTTPS_4443.bindTo(flagSource); } public TesterCloud cloud() { return cloud; } @@ -486,17 +480,7 @@ public class JobController { .stream().findAny() .or(() -> controller.applications().routingPolicies().get(testerId).stream() .findAny() - .map(policy -> policy.endpointIn(controller.system()).url())) - .map(url -> withWorkingSchemeAndPort(url, id.tester().id())); - } - - // TODO jvenstad: Remove ugly thing when public deployments have a valid web certificate. - URI withWorkingSchemeAndPort(URI url, ApplicationId id) { - if ( ! controller.system().isPublic() - || directRoutingUseHttps.with(FetchVector.Dimension.APPLICATION_ID, id.serializedForm()).value()) - return url; - - return URI.create("http://" + url.getHost() + ":443/"); + .map(policy -> policy.endpointIn(controller.system()).url())); } /** Returns a set containing the zone of the deployment tested in the given run, and all production zones for the application. */ |