Skip to content

Commit ff6ad58

Browse files
committed
Make testclusters registry extension name unique (#49956)
The testclusters registory is a singleton extension element added to the root project which tracks which test clusters are used throughout the multi project. But having the same name as the extension used to configure test clusters within each subprojects breaks using a single project for an external plugin. This commit renames the registry extension to make it unique. closes #49787
1 parent fdfb195 commit ff6ad58

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/TestClustersPlugin.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class TestClustersPlugin implements Plugin<Project> {
3838

3939
private static final String LIST_TASK_NAME = "listTestClusters";
4040
public static final String EXTENSION_NAME = "testClusters";
41+
private static final String REGISTRY_EXTENSION_NAME = "testClustersRegistry";
4142

4243
private static final Logger logger = Logging.getLogger(TestClustersPlugin.class);
4344

@@ -56,9 +57,9 @@ public void apply(Project project) {
5657
// provide a task to be able to list defined clusters.
5758
createListClustersTask(project, container);
5859

59-
if (project.getRootProject().getExtensions().findByName("testClusters") == null) {
60+
if (project.getRootProject().getExtensions().findByName(REGISTRY_EXTENSION_NAME) == null) {
6061
TestClustersRegistry registry = project.getRootProject().getExtensions()
61-
.create("testClusters", TestClustersRegistry.class);
62+
.create(REGISTRY_EXTENSION_NAME, TestClustersRegistry.class);
6263

6364
// When we know what tasks will run, we claim the clusters of those task to differentiate between clusters
6465
// that are defined in the build script and the ones that will actually be used in this invocation of gradle

0 commit comments

Comments
 (0)