summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2023-01-27 18:03:07 +0100
committerjonmv <venstad@gmail.com>2023-01-27 18:03:07 +0100
commit5aa00fffe0b3ebae4f0252031b6ad9214b4d6ff8 (patch)
tree762e4df9d59ba7ad4a2b3928b35fbd3ce2a23103 /controller-api
parent1770e53c93134b268f0fac6239bc84b8f15688c4 (diff)
Revert "Merge pull request #25770 from vespa-engine/jonmv/private-endpoints"
This reverts commit a3ae8f5b0ec3a7f2f3c9205289470dbb89e477ff, reversing changes made to 6534f02466a8958513a8b8684cc2a4369fab7666.
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java4
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/LoadBalancer.java78
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TesterCloud.java14
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockTesterCloud.java17
4 files changed, 80 insertions, 33 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java
index 93ac16c606d..cc05bc01d99 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java
@@ -4,8 +4,6 @@ package com.yahoo.vespa.hosted.controller.api.integration.configserver;
import ai.vespa.http.HttpURL.Query;
import com.yahoo.component.Version;
import com.yahoo.config.provision.ApplicationId;
-import com.yahoo.config.provision.EndpointsChecker.Availability;
-import com.yahoo.config.provision.EndpointsChecker.Endpoint;
import com.yahoo.config.provision.zone.ZoneId;
import ai.vespa.http.DomainName;
import ai.vespa.http.HttpURL.Path;
@@ -147,8 +145,6 @@ public interface ConfigServer {
Optional<TestReport> getTestReport(DeploymentId deployment);
- Availability verifyEndpoints(DeploymentId deploymentId, List<Endpoint> zoneEndpoints);
-
/** Get maximum resources consumed */
QuotaUsage getQuotaUsage(DeploymentId deploymentId);
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/LoadBalancer.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/LoadBalancer.java
index 0c81fbd3670..26330f11d65 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/LoadBalancer.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/LoadBalancer.java
@@ -8,30 +8,74 @@ import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.config.provision.ZoneEndpoint.AllowedUrn;
import java.util.List;
+import java.util.Objects;
import java.util.Optional;
-import static java.util.Objects.requireNonNull;
-
/**
* Represents an exclusive load balancer, assigned to an application's cluster.
*
* @author mortent
*/
-public record LoadBalancer(String id, ApplicationId application, ClusterSpec.Id cluster,
- Optional<DomainName> hostname, Optional<String> ipAddress,
- State state, Optional<String> dnsZone, Optional<CloudAccount> cloudAccount,
- Optional<PrivateServiceInfo> service, boolean isPublic) {
-
- public LoadBalancer {
- requireNonNull(id, "id must be non-null");
- requireNonNull(application, "application must be non-null");
- requireNonNull(cluster, "cluster must be non-null");
- requireNonNull(hostname, "hostname must be non-null");
- requireNonNull(ipAddress, "ipAddress must be non-null");
- requireNonNull(state, "state must be non-null");
- requireNonNull(dnsZone, "dnsZone must be non-null");
- requireNonNull(cloudAccount, "cloudAccount must be non-null");
- requireNonNull(service, "service must be non-null");
+public class LoadBalancer {
+
+ private final String id;
+ private final ApplicationId application;
+ private final ClusterSpec.Id cluster;
+ private final Optional<DomainName> hostname;
+ private final Optional<String> ipAddress;
+ private final State state;
+ private final Optional<String> dnsZone;
+ private final Optional<CloudAccount> cloudAccount;
+ private final Optional<PrivateServiceInfo> service;
+
+ public LoadBalancer(String id, ApplicationId application, ClusterSpec.Id cluster, Optional<DomainName> hostname,
+ Optional<String> ipAddress, State state, Optional<String> dnsZone,
+ Optional<CloudAccount> cloudAccount, Optional<PrivateServiceInfo> service) {
+ this.id = Objects.requireNonNull(id, "id must be non-null");
+ this.application = Objects.requireNonNull(application, "application must be non-null");
+ this.cluster = Objects.requireNonNull(cluster, "cluster must be non-null");
+ this.hostname = Objects.requireNonNull(hostname, "hostname must be non-null");
+ this.ipAddress = Objects.requireNonNull(ipAddress, "ipAddress must be non-null");
+ this.state = Objects.requireNonNull(state, "state must be non-null");
+ this.dnsZone = Objects.requireNonNull(dnsZone, "dnsZone must be non-null");
+ this.cloudAccount = Objects.requireNonNull(cloudAccount, "cloudAccount must be non-null");
+ this.service = Objects.requireNonNull(service, "service must be non-null");
+ }
+
+ public String id() {
+ return id;
+ }
+
+ public ApplicationId application() {
+ return application;
+ }
+
+ public ClusterSpec.Id cluster() {
+ return cluster;
+ }
+
+ public Optional<DomainName> hostname() {
+ return hostname;
+ }
+
+ public Optional<String> ipAddress() {
+ return ipAddress;
+ }
+
+ public Optional<String> dnsZone() {
+ return dnsZone;
+ }
+
+ public State state() {
+ return state;
+ }
+
+ public Optional<CloudAccount> cloudAccount() {
+ return cloudAccount;
+ }
+
+ public Optional<PrivateServiceInfo> service() {
+ return service;
}
public enum State {
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TesterCloud.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TesterCloud.java
index 4095e4b03fd..b4d9dd49880 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TesterCloud.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TesterCloud.java
@@ -1,11 +1,12 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.deployment;
-import com.yahoo.config.provision.EndpointsChecker.Endpoint;
-import com.yahoo.config.provision.EndpointsChecker.Availability;
+import ai.vespa.http.DomainName;
+import com.yahoo.config.provision.Environment;
import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId;
import com.yahoo.vespa.hosted.controller.api.integration.LogEntry;
+import java.net.InetAddress;
import java.net.URI;
import java.util.List;
import java.util.Optional;
@@ -26,10 +27,17 @@ public interface TesterCloud {
/** Returns the current status of the tester. */
Status getStatus(DeploymentId deploymentId);
+ /** Returns whether the container is ready to serve. */
+ boolean ready(URI endpointUrl);
+
/** Returns whether the test container is ready to serve */
boolean testerReady(DeploymentId deploymentId);
- Availability verifyEndpoints(DeploymentId deploymentId, List<Endpoint> endpoints);
+ /** Returns the IP address of the given host name, if any. */
+ Optional<InetAddress> resolveHostName(DomainName hostname);
+
+ /** Returns the host name of the given CNAME, if any. */
+ Optional<DomainName> resolveCname(DomainName hostName);
/** Returns the test report as JSON if available */
Optional<TestReport> getTestReport(DeploymentId deploymentId);
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockTesterCloud.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockTesterCloud.java
index e29e8086c80..939c74fe61d 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockTesterCloud.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockTesterCloud.java
@@ -3,9 +3,6 @@ package com.yahoo.vespa.hosted.controller.api.integration.stubs;
import ai.vespa.http.DomainName;
import com.google.common.net.InetAddresses;
-import com.yahoo.config.provision.EndpointsChecker;
-import com.yahoo.config.provision.EndpointsChecker.Endpoint;
-import com.yahoo.config.provision.EndpointsChecker.Availability;
import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId;
import com.yahoo.vespa.hosted.controller.api.integration.LogEntry;
import com.yahoo.vespa.hosted.controller.api.integration.deployment.TestReport;
@@ -19,6 +16,7 @@ import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
+import java.util.stream.Collectors;
import static com.yahoo.vespa.hosted.controller.api.integration.deployment.TesterCloud.Status.NOT_STARTED;
import static com.yahoo.vespa.hosted.controller.api.integration.deployment.TesterCloud.Status.RUNNING;
@@ -26,7 +24,6 @@ import static com.yahoo.vespa.hosted.controller.api.integration.deployment.Teste
public class MockTesterCloud implements TesterCloud {
private final NameService nameService;
- private final EndpointsChecker endpointsChecker = EndpointsChecker.mock(this::resolveHostName, this::resolveCname, __ -> true);
private List<LogEntry> log = new ArrayList<>();
private Status status = NOT_STARTED;
@@ -52,23 +49,25 @@ public class MockTesterCloud implements TesterCloud {
public Status getStatus(DeploymentId deploymentId) { return status; }
@Override
- public boolean testerReady(DeploymentId deploymentId) {
+ public boolean ready(URI testerUrl) {
return true;
}
@Override
- public Availability verifyEndpoints(DeploymentId deploymentId, List<Endpoint> endpoints) {
- return endpointsChecker.endpointsAvailable(endpoints);
+ public boolean testerReady(DeploymentId deploymentId) {
+ return true;
}
- private Optional<InetAddress> resolveHostName(DomainName hostname) {
+ @Override
+ public Optional<InetAddress> resolveHostName(DomainName hostname) {
return nameService.findRecords(Record.Type.A, RecordName.from(hostname.value())).stream()
.findFirst()
.map(record -> InetAddresses.forString(record.data().asString()))
.or(() -> Optional.of(InetAddresses.forString("1.2.3.4")));
}
- private Optional<DomainName> resolveCname(DomainName hostName) {
+ @Override
+ public Optional<DomainName> resolveCname(DomainName hostName) {
return nameService.findRecords(Record.Type.CNAME, RecordName.from(hostName.value())).stream()
.findFirst()
.map(record -> DomainName.of(record.data().asString().substring(0, record.data().asString().length() - 1)));