From 68c1ce17f179e428d41de19e8a9b160d6f2288bc Mon Sep 17 00:00:00 2001 From: Ola Aunrønning Date: Thu, 27 Jan 2022 18:45:04 +0100 Subject: Keep one old version. Don't keep hash of entire package. --- .../integration/deployment/ApplicationVersion.java | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java') diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java index 984035645ed..8fd5c8cfdd7 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java @@ -24,7 +24,7 @@ public class ApplicationVersion implements Comparable { public static final ApplicationVersion unknown = new ApplicationVersion(Optional.empty(), OptionalLong.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), true, - Optional.empty(), Optional.empty()); + Optional.empty()); // This never changes and is only used to create a valid semantic version number, as required by application bundles private static final String majorVersion = "1.0"; @@ -37,13 +37,12 @@ public class ApplicationVersion implements Comparable { private final Optional sourceUrl; private final Optional commit; private final boolean deployedDirectly; - private final Optional applicationPackageHash; private final Optional bundleHash; /** Public for serialisation only. */ public ApplicationVersion(Optional source, OptionalLong buildNumber, Optional authorEmail, Optional compileVersion, Optional buildTime, Optional sourceUrl, - Optional commit, boolean deployedDirectly, Optional applicationPackageHash, Optional bundleHash) { + Optional commit, boolean deployedDirectly, Optional bundleHash) { if (buildNumber.isEmpty() && ( source.isPresent() || authorEmail.isPresent() || compileVersion.isPresent() || buildTime.isPresent() || sourceUrl.isPresent() || commit.isPresent())) throw new IllegalArgumentException("Build number must be present if any other attribute is"); @@ -68,7 +67,6 @@ public class ApplicationVersion implements Comparable { this.sourceUrl = Objects.requireNonNull(sourceUrl, "sourceUrl cannot be null"); this.commit = Objects.requireNonNull(commit, "commit cannot be null"); this.deployedDirectly = deployedDirectly; - this.applicationPackageHash = applicationPackageHash; this.bundleHash = bundleHash; } @@ -76,7 +74,7 @@ public class ApplicationVersion implements Comparable { public static ApplicationVersion from(SourceRevision source, long buildNumber) { return new ApplicationVersion(Optional.of(source), OptionalLong.of(buildNumber), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), false, - Optional.empty(), Optional.empty()); + Optional.empty()); } /** Creates a version from a completed build, an author email, and build meta data. */ @@ -84,15 +82,15 @@ public class ApplicationVersion implements Comparable { Version compileVersion, Instant buildTime) { return new ApplicationVersion(Optional.of(source), OptionalLong.of(buildNumber), Optional.of(authorEmail), Optional.of(compileVersion), Optional.of(buildTime), Optional.empty(), Optional.empty(), false, - Optional.empty(), Optional.empty()); + Optional.empty()); } /** Creates a version from a completed build, an author email, and build meta data. */ public static ApplicationVersion from(Optional source, long buildNumber, Optional authorEmail, Optional compileVersion, Optional buildTime, Optional sourceUrl, Optional commit, boolean deployedDirectly, - Optional applicationPackageHash, Optional bundleHash ) { - return new ApplicationVersion(source, OptionalLong.of(buildNumber), authorEmail, compileVersion, buildTime, sourceUrl, commit, deployedDirectly, applicationPackageHash, bundleHash); + Optional bundleHash) { + return new ApplicationVersion(source, OptionalLong.of(buildNumber), authorEmail, compileVersion, buildTime, sourceUrl, commit, deployedDirectly, bundleHash); } /** Returns a unique identifier for this version or "unknown" if version is not known */ @@ -123,11 +121,6 @@ public class ApplicationVersion implements Comparable { /** Returns the time this package was built, if known. */ public Optional buildTime() { return buildTime; } - /** Returns the hash of entire application package */ - public Optional applicationPackageHash() { - return applicationPackageHash; - } - /** Returns the hash of app package except deployment/build-meta data */ public Optional bundleHash() { return bundleHash; -- cgit v1.2.3