diff options
Diffstat (limited to 'config-provisioning')
-rw-r--r-- | config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java | 6 | ||||
-rw-r--r-- | config-provisioning/src/test/java/com/yahoo/config/provision/ClusterSpecTest.java | 2 |
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 e1a28e3f8d7..ea4411c03ab 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 @@ -111,8 +111,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 + if (other.type.isContent() || this.type.isContent()) // Allow seamless transition between content and combined + 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) -> { |