summaryrefslogtreecommitdiffstats
path: root/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java')
-rw-r--r--config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java27
1 files changed, 21 insertions, 6 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java b/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java
index 07b120bed73..ec655f0eee2 100644
--- a/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java
+++ b/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java
@@ -19,9 +19,9 @@ public final class ClusterSpec {
/** The group id of these hosts, or empty if this is represents a request for hosts */
private final Optional<Group> groupId;
- private final Optional<Version> vespaVersion;
+ private final Version vespaVersion;
- private ClusterSpec(Type type, Id id, Optional<Group> groupId, Optional<Version> vespaVersion) {
+ private ClusterSpec(Type type, Id id, Optional<Group> groupId, Version vespaVersion) {
this.type = type;
this.id = id;
this.groupId = groupId;
@@ -34,10 +34,10 @@ public final class ClusterSpec {
/** Returns the cluster id */
public Id id() { return id; }
- public Optional<Version> vespaVersion() { return vespaVersion; }
+ public Version vespaVersion() { return vespaVersion; }
- public Optional<String> dockerImage() {
- return vespaVersion.map(DockerImage.defaultImage::withTag).map(DockerImage::toString);
+ public String dockerImage() {
+ return DockerImage.defaultImage.withTag(vespaVersion).toString();
}
/** Returns the group within the cluster this specifies, or empty to specify the whole cluster */
@@ -53,20 +53,35 @@ public final class ClusterSpec {
}
/** Create a specification <b>requesting</b> a cluster with these attributes */
+ // TODO: April 2017 - Remove this when no version older than 6.97 is used anywhere
public static ClusterSpec requestVersion(Type type, Id id, Optional<Version> vespaVersion) {
+ return new ClusterSpec(type, id, Optional.empty(), vespaVersion.get());
+ }
+
+ public static ClusterSpec request(Type type, Id id, Version vespaVersion) {
return new ClusterSpec(type, id, Optional.empty(), vespaVersion);
}
/** Create a specification <b>specifying</b> an existing cluster group having these attributes */
+ // TODO: April 2017 - Remove this when no version older than 6.97 is used anywhere
public static ClusterSpec from(Type type, Id id, Group groupId, Optional<Version> vespaVersion) {
+ return new ClusterSpec(type, id, Optional.of(groupId), vespaVersion.get());
+ }
+
+ /** Create a specification <b>specifying</b> an existing cluster group having these attributes */
+ // TODO: April 2017 - Remove this when no version older than 6.97 is used anywhere
+ public static ClusterSpec from(Type type, Id id, Group groupId, Version vespaVersion) {
return new ClusterSpec(type, id, Optional.of(groupId), vespaVersion);
}
+ neste: - sørg for at ingen bruker deprecateds over
+ - gå tilbake til NodeSpecification og sørg for at version sendes inn der fra ModelContext
+
@Override
public String toString() {
return String.join(" ", type.toString(), id.toString(),
groupId.map(Group::toString).orElse(""),
- vespaVersion.orElse(Version.emptyVersion).toString());
+ vespaVersion.toString());
}
@Override