diff options
Diffstat (limited to 'node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/OsVersion.java')
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/OsVersion.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/OsVersion.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/OsVersion.java index 2e0e780182b..ffb9477c88e 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/OsVersion.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/OsVersion.java @@ -43,6 +43,11 @@ public class OsVersion { return wanted.isPresent() && !current.equals(wanted); } + /** Returns whether this node is downgrading its version */ + public boolean downgrading() { + return (wanted.isPresent() && current.isPresent()) && wanted.get().isBefore(current.get()); + } + /** Returns whether this is before the given version */ public boolean isBefore(Version version) { return current.isEmpty() || current.get().isBefore(version); |