summaryrefslogtreecommitdiffstats
path: root/controller-api/src/main/java/com
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2018-08-14 15:30:08 +0200
committerMartin Polden <mpolden@mpolden.no>2018-08-16 10:40:30 +0200
commit354f7fa63b13ce006afec7e2a7c23c3c6a285ff6 (patch)
tree5b05c1b7d1571be7b290d34ab2551e43e85615e9 /controller-api/src/main/java/com
parent5a41b6ea1ad56853854b47331f61d90d70ee9b75 (diff)
Implement OsUpgrader
Diffstat (limited to 'controller-api/src/main/java/com')
-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.java5
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneRegistry.java6
3 files changed, 33 insertions, 2 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 cdd87349037..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
@@ -30,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 196593883fe..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
@@ -52,4 +52,10 @@ public interface ZoneRegistry {
/** 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();
+ }
+
}