aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorHÃ¥kon Hallingstad <hakon@yahooinc.com>2022-01-05 19:32:26 +0100
committerGitHub <noreply@github.com>2022-01-05 19:32:26 +0100
commitc6972162154fa3e580e4a3311739f22a609f534e (patch)
tree9a15bab4af9db1c4173cc568f1e68380ffaf9a97 /controller-server
parentf240234d803a4848652d427c6303436fe7ca822b (diff)
parent4b515262ea09f1687e6ac9021219b6b2d7d54e61 (diff)
Merge pull request #20656 from vespa-engine/hakonhall/use-infrastructureapplication-try-2
Use InfrastructureApplication, try 2
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/pom.xml7
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/SystemApplication.java30
2 files changed, 21 insertions, 16 deletions
diff --git a/controller-server/pom.xml b/controller-server/pom.xml
index e9fadee58c7..fa4a0dc06d6 100644
--- a/controller-server/pom.xml
+++ b/controller-server/pom.xml
@@ -70,6 +70,13 @@
<dependency>
<groupId>com.yahoo.vespa</groupId>
+ <artifactId>application-model</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.yahoo.vespa</groupId>
<artifactId>vespa-athenz</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/SystemApplication.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/SystemApplication.java
index 2819e382017..613422b2749 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/SystemApplication.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/SystemApplication.java
@@ -3,11 +3,11 @@ package com.yahoo.vespa.hosted.controller.application;
import com.yahoo.component.Version;
import com.yahoo.config.provision.ApplicationId;
-import com.yahoo.config.provision.InstanceName;
import com.yahoo.config.provision.NodeType;
import com.yahoo.config.provision.TenantName;
import com.yahoo.config.provision.zone.ZoneId;
import com.yahoo.text.Text;
+import com.yahoo.vespa.applicationmodel.InfrastructureApplication;
import com.yahoo.vespa.hosted.controller.Controller;
import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId;
import com.yahoo.vespa.hosted.controller.api.integration.configserver.ServiceConvergence;
@@ -26,33 +26,31 @@ import java.util.Optional;
*/
public enum SystemApplication {
- controllerHost("controller-host", NodeType.controllerhost),
- configServerHost("configserver-host", NodeType.confighost),
- configServer("zone-config-servers", NodeType.config),
- proxyHost("proxy-host", NodeType.proxyhost),
- proxy( "routing", NodeType.proxy, proxyHost, configServer),
- tenantHost("tenant-host", NodeType.host);
+ controllerHost(InfrastructureApplication.CONTROLLER_HOST),
+ configServerHost(InfrastructureApplication.CONFIG_SERVER_HOST),
+ configServer(InfrastructureApplication.CONFIG_SERVER),
+ proxyHost(InfrastructureApplication.PROXY_HOST),
+ proxy(InfrastructureApplication.PROXY, proxyHost, configServer),
+ tenantHost(InfrastructureApplication.TENANT_HOST);
/** The tenant owning all system applications */
public static final TenantName TENANT = TenantName.from(Constants.TENANT_NAME);
- private final ApplicationId id;
- private final NodeType nodeType;
+ private final InfrastructureApplication application;
private final List<SystemApplication> dependencies;
- SystemApplication(String application, NodeType nodeType, SystemApplication... dependencies) {
- this.id = ApplicationId.from(Constants.TENANT_NAME, application, InstanceName.defaultName().value());
- this.nodeType = nodeType;
+ SystemApplication(InfrastructureApplication application, SystemApplication... dependencies) {
+ this.application = application;
this.dependencies = List.of(dependencies);
}
public ApplicationId id() {
- return id;
+ return application.id();
}
/** The node type that is implicitly allocated to this */
public NodeType nodeType() {
- return nodeType;
+ return application.nodeType();
}
/** Returns the system applications that should upgrade before this */
@@ -75,7 +73,7 @@ public enum SystemApplication {
/** Returns whether this should receive OS upgrades */
public boolean shouldUpgradeOs() {
- return nodeType.isHost();
+ return nodeType().isHost();
}
/** Returns whether this has an endpoint */
@@ -106,7 +104,7 @@ public enum SystemApplication {
@Override
public String toString() {
- return Text.format("system application %s of type %s", id, nodeType);
+ return Text.format("system application %s of type %s", id(), nodeType());
}
private static class Constants {