diff options
author | Martin Polden <mpolden@mpolden.no> | 2021-06-22 08:49:05 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2021-06-23 09:05:03 +0200 |
commit | 6b06725c019e4c1e16f293de88ce21e4afc675f5 (patch) | |
tree | 76805ba40366247da9167c6c856079153e0a22a8 /controller-api | |
parent | ed7bc94c5c184b1dc735d8db4f95894102cd46f2 (diff) |
Schedule upgrade to stable OS version
Diffstat (limited to 'controller-api')
2 files changed, 55 insertions, 0 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ArtifactRepository.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ArtifactRepository.java index 97f3acda67c..4a6cb10c5c2 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ArtifactRepository.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ArtifactRepository.java @@ -15,4 +15,7 @@ public interface ArtifactRepository { /** Returns the system application package of the given version. */ byte[] getSystemApplicationPackage(ApplicationId application, ZoneId zone, Version version); + /** Returns the current stable OS version for the given major version */ + StableOsVersion stableOsVersion(int major); + } diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/StableOsVersion.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/StableOsVersion.java new file mode 100644 index 00000000000..0eabb0b6b8a --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/StableOsVersion.java @@ -0,0 +1,52 @@ +// Copyright Verizon Media. 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.component.Version; + +import java.time.Instant; +import java.util.Objects; + +/** + * A stable OS version. + * + * @author mpolden + */ +public class StableOsVersion { + + private final Version version; + private final Instant promotedAt; + + public StableOsVersion(Version version, Instant promotedAt) { + this.version = Objects.requireNonNull(version); + this.promotedAt = Objects.requireNonNull(promotedAt); + } + + /** The version number */ + public Version version() { + return version; + } + + /** Returns the time this was promoted to stable */ + public Instant promotedAt() { + return promotedAt; + } + + @Override + public String toString() { + return "os version " + version + ", promoted at " + promotedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + StableOsVersion that = (StableOsVersion) o; + return version.equals(that.version) && promotedAt.equals(that.promotedAt); + } + + @Override + public int hashCode() { + return Objects.hash(version, promotedAt); + } + +} |