summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2021-06-23 10:28:05 +0200
committerGitHub <noreply@github.com>2021-06-23 10:28:05 +0200
commit46115c5f317ea08f2f39f314a84025181b957a1c (patch)
tree55403d4d8bd49f2ef3261fbb6a54f8149219a56f /controller-api
parentf0bc35857d59917bc859d642489206ca95c84981 (diff)
parent89c7c96cb95de8f29633a4452fdc9f18ae9e1361 (diff)
Merge pull request #18375 from vespa-engine/mpolden/schedule-stable-os-version
Schedule upgrade to stable OS version
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ArtifactRepository.java3
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/StableOsVersion.java52
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);
+ }
+
+}