summaryrefslogtreecommitdiffstats
path: root/config-provisioning
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2020-01-13 16:16:19 +0100
committerMartin Polden <mpolden@mpolden.no>2020-01-13 16:17:32 +0100
commite22bb6f5ca207e897dcde8a65416f46f2a039583 (patch)
tree4a6b7fbf095a853e71fc7fd3bee354f9952049fc /config-provisioning
parent4e2478aabcd2ed3945ac0294cefd2cf325e39bbf (diff)
Revert "Remove unnecessary content/combined substitution"
This reverts commit 0e3637dfdd8c7301cefe986c889971efad1f3781. Removed too early. Need to wait until old config models disappear.
Diffstat (limited to 'config-provisioning')
-rw-r--r--config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java6
-rw-r--r--config-provisioning/src/test/java/com/yahoo/config/provision/ClusterSpecTest.java2
2 files changed, 5 insertions, 3 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 16369d82f9f..f1a8b579866 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
@@ -90,8 +90,10 @@ public final class ClusterSpec {
* are ignored.
*/
public boolean satisfies(ClusterSpec other) {
- return other.id.equals(this.id) &&
- other.type.equals(this.type);
+ if ( ! other.id.equals(this.id)) return false; // ID mismatch
+ // TODO(mpolden): Remove this after January 2019, once all nodes in combined clusters have type combined.
+ if (other.type.isContent() || this.type.isContent()) return other.type.isContent() == this.type.isContent();
+ return other.type.equals(this.type);
}
/** A cluster type */
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 dc198e5bb0d..db90b0ebff9 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
@@ -40,7 +40,7 @@ public class ClusterSpecTest {
List.of(spec(ClusterSpec.Type.admin, "id1"), spec(ClusterSpec.Type.container, "id1")), false,
List.of(spec(ClusterSpec.Type.admin, "id1"), spec(ClusterSpec.Type.content, "id1")), false,
List.of(spec(ClusterSpec.Type.combined, "id1"), spec(ClusterSpec.Type.container, "id1")), false,
- List.of(spec(ClusterSpec.Type.combined, "id1"), spec(ClusterSpec.Type.content, "id1")), false,
+ List.of(spec(ClusterSpec.Type.combined, "id1"), spec(ClusterSpec.Type.content, "id1")), true,
List.of(spec(ClusterSpec.Type.content, "id1"), spec(ClusterSpec.Type.content, "id1")), true
);
tests.forEach((specs, satisfies) -> {