summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java24
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/NodeRepository.java8
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneRegistry.java8
3 files changed, 36 insertions, 4 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java
index 90864730a15..e51814e44f8 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java
@@ -24,6 +24,8 @@ public class Node {
private final Optional<ApplicationId> owner;
private final Version currentVersion;
private final Version wantedVersion;
+ private final Version currentOsVersion;
+ private final Version wantedOsVersion;
private final ServiceState serviceState;
private final long restartGeneration;
private final long wantedRestartGeneration;
@@ -31,7 +33,7 @@ public class Node {
private final long wantedRebootGeneration;
public Node(HostName hostname, State state, NodeType type, Optional<ApplicationId> owner,
- Version currentVersion, Version wantedVersion, ServiceState serviceState,
+ Version currentVersion, Version wantedVersion, Version currentOsVersion, Version wantedOsVersion, ServiceState serviceState,
long restartGeneration, long wantedRestartGeneration, long rebootGeneration, long wantedRebootGeneration) {
this.hostname = hostname;
this.state = state;
@@ -39,6 +41,8 @@ public class Node {
this.owner = owner;
this.currentVersion = currentVersion;
this.wantedVersion = wantedVersion;
+ this.currentOsVersion = currentOsVersion;
+ this.wantedOsVersion = wantedOsVersion;
this.serviceState = serviceState;
this.restartGeneration = restartGeneration;
this.wantedRestartGeneration = wantedRestartGeneration;
@@ -46,11 +50,19 @@ public class Node {
this.wantedRebootGeneration = wantedRebootGeneration;
}
+ // TODO: Remove once internal code supports new constructor
+ public Node(HostName hostname, State state, NodeType type, Optional<ApplicationId> owner,
+ Version currentVersion, Version wantedVersion, ServiceState serviceState,
+ long restartGeneration, long wantedRestartGeneration, long rebootGeneration, long wantedRebootGeneration) {
+ this(hostname, state, type, owner, currentVersion, wantedVersion, Version.emptyVersion, Version.emptyVersion,
+ serviceState, restartGeneration, wantedRestartGeneration, rebootGeneration, wantedRebootGeneration);
+ }
+
@TestOnly
public Node(HostName hostname, State state, NodeType type, Optional<ApplicationId> owner,
Version currentVersion, Version wantedVersion) {
this(hostname, state, type, owner, currentVersion, wantedVersion,
- ServiceState.unorchestrated, 0, 0, 0, 0);
+ Version.emptyVersion, Version.emptyVersion, ServiceState.unorchestrated, 0, 0, 0, 0);
}
public HostName hostname() {
@@ -75,6 +87,14 @@ public class Node {
return wantedVersion;
}
+ public Version currentOsVersion() {
+ return currentOsVersion;
+ }
+
+ public Version wantedOsVersion() {
+ return wantedOsVersion;
+ }
+
public ServiceState serviceState() {
return serviceState;
}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/NodeRepository.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/NodeRepository.java
index 8147646bf06..92d07edaca8 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/NodeRepository.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/NodeRepository.java
@@ -7,6 +7,7 @@ import com.yahoo.config.provision.NodeType;
import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneId;
import java.util.List;
+import java.util.Set;
import java.util.stream.Collectors;
/**
@@ -20,7 +21,7 @@ public interface NodeRepository {
List<Node> list(ZoneId zone, ApplicationId application);
/** List all nodes in states, in zone owned by given application */
- default List<Node> list(ZoneId zone, ApplicationId application, List<Node.State> states) {
+ default List<Node> list(ZoneId zone, ApplicationId application, Set<Node.State> states) {
return list(zone, application).stream()
.filter(node -> states.contains(node.state()))
.collect(Collectors.toList());
@@ -29,4 +30,9 @@ public interface NodeRepository {
/** Upgrade all nodes of given type to a new version */
void upgrade(ZoneId zone, NodeType type, Version version);
+ /** Upgrade OS for all nodes of given type to a new version */
+ default void upgradeOs(ZoneId zone, NodeType type, Version version) {
+ // TODO: Remove default implementation once implemented in internal code
+ }
+
}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneRegistry.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneRegistry.java
index dea14493d26..f721564c80e 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneRegistry.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneRegistry.java
@@ -49,7 +49,13 @@ public interface ZoneRegistry {
/** Return the configserver's Athenz service identity */
AthenzService getConfigServerAthenzService(ZoneId zoneId);
- /** Returns the upgrade policy to use for zones in this registry */
+ /** Returns the Vespa upgrade policy to use for zones in this registry */
UpgradePolicy upgradePolicy();
+ /** Returns the OS upgrade policy to use for zones in this registry */
+ // TODO: Remove default once internal code implements this
+ default UpgradePolicy osUpgradePolicy() {
+ return upgradePolicy();
+ }
+
}