diff options
Diffstat (limited to 'config-provisioning/src')
-rw-r--r-- | config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java | 9 | ||||
-rw-r--r-- | config-provisioning/src/test/java/com/yahoo/config/provision/ClusterSpecTest.java | 11 |
2 files changed, 12 insertions, 8 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 f7030535573..7c2c491ccf1 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 @@ -31,13 +31,14 @@ public final class ClusterSpec { this.groupId = groupId; this.vespaVersion = Objects.requireNonNull(vespaVersion); this.exclusive = exclusive; - // TODO(mpolden): Require combinedId to always be present for type combined after April 2020 - if (type != Type.combined && combinedId.isPresent()) { - throw new IllegalArgumentException("combinedId must be empty for cluster of type " + type); + if (type == Type.combined) { + if (combinedId.isEmpty()) throw new IllegalArgumentException("combinedId must be set for cluster of type " + type); + } else { + if (combinedId.isPresent()) throw new IllegalArgumentException("combinedId must be empty for cluster of type " + type); } this.combinedId = combinedId; if (dockerImageRepo.isPresent() && dockerImageRepo.get().tag().isPresent()) - throw new IllegalArgumentException("dockerimageRepo is not allowed to have a tag"); + throw new IllegalArgumentException("dockerImageRepo is not allowed to have a tag"); this.dockerImageRepo = dockerImageRepo; } diff --git a/config-provisioning/src/test/java/com/yahoo/config/provision/ClusterSpecTest.java b/config-provisioning/src/test/java/com/yahoo/config/provision/ClusterSpecTest.java index 40ed7500269..be4179e8b03 100644 --- a/config-provisioning/src/test/java/com/yahoo/config/provision/ClusterSpecTest.java +++ b/config-provisioning/src/test/java/com/yahoo/config/provision/ClusterSpecTest.java @@ -53,10 +53,13 @@ public class ClusterSpecTest { } private static ClusterSpec spec(ClusterSpec.Type type, String id) { - return ClusterSpec.specification(type, ClusterSpec.Id.from(id)) - .group(ClusterSpec.Group.from(1)) - .vespaVersion(Version.emptyVersion) - .build(); + ClusterSpec.Builder builder = ClusterSpec.specification(type, ClusterSpec.Id.from(id)) + .group(ClusterSpec.Group.from(1)) + .vespaVersion(Version.emptyVersion); + if (type == ClusterSpec.Type.combined) { + builder = builder.combinedId(Optional.of(ClusterSpec.Id.from("combined"))); + } + return builder.build(); } } |