diff options
author | Martin Polden <mpolden@mpolden.no> | 2022-01-10 14:02:40 +0100 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2022-01-10 14:02:40 +0100 |
commit | 82a734fc6bea66959852bcf3471f228a60a68607 (patch) | |
tree | 22c0720af5cfa045dcba050303e2c51b9e74eba6 /controller-api | |
parent | c0c25b25dc02315e3d5bc09a720db8f02e42e2b2 (diff) |
Track latest OS release in CD system
Diffstat (limited to 'controller-api')
3 files changed, 67 insertions, 54 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 4f2ab2b1734..c06ade1adcf 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,7 +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); + /** Returns the current OS release with the given major version and tag */ + OsRelease osRelease(int major, OsRelease.Tag tag); } diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/OsRelease.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/OsRelease.java new file mode 100644 index 00000000000..d80b2201810 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/OsRelease.java @@ -0,0 +1,65 @@ +// Copyright Yahoo. 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; + +/** + * An OS release and its tag. + * + * @author mpolden + */ +public class OsRelease { + + private final Version version; + private final Tag tag; + private final Instant taggedAt; + + public OsRelease(Version version, Tag tag, Instant taggedAt) { + this.version = Objects.requireNonNull(version); + this.tag = Objects.requireNonNull(tag); + this.taggedAt = Objects.requireNonNull(taggedAt); + } + + /** The version number */ + public Version version() { + return version; + } + + /** The tag of this */ + public Tag tag() { + return tag; + } + + /** Returns the time this was tagged */ + public Instant taggedAt() { + return taggedAt; + } + + @Override + public String toString() { + return "os release " + version + ", tagged " + tag + " at " + taggedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + OsRelease osRelease = (OsRelease) o; + return version.equals(osRelease.version) && tag == osRelease.tag && taggedAt.equals(osRelease.taggedAt); + } + + @Override + public int hashCode() { + return Objects.hash(version, tag, taggedAt); + } + + /** Known release tags */ + public enum Tag { + latest, + stable, + } + +} 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 deleted file mode 100644 index 98bf5d9d0d7..00000000000 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/StableOsVersion.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright Yahoo. 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); - } - -} |