From 6b06725c019e4c1e16f293de88ce21e4afc675f5 Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Tue, 22 Jun 2021 08:49:05 +0200 Subject: Schedule upgrade to stable OS version --- .../integration/deployment/ArtifactRepository.java | 3 ++ .../integration/deployment/StableOsVersion.java | 52 ++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/StableOsVersion.java (limited to 'controller-api') 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); + } + +} -- cgit v1.2.3