Skip to content

Commit 507e98b

Browse files
Fixing cluster check
1 parent 3dfff85 commit 507e98b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

x-pack/plugin/inference/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/xpack/application/AuthorizationTaskExecutorUpgradeIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.Map;
2222

2323
import static org.elasticsearch.xpack.inference.InferenceBaseRestTest.assertStatusOkOrCreated;
24+
import static org.elasticsearch.xpack.inference.InferenceFeatures.INFERENCE_AUTH_POLLER_PERSISTENT_TASK;
2425
import static org.elasticsearch.xpack.inference.services.elastic.ElasticInferenceServiceSettings.ELASTIC_INFERENCE_SERVICE_URL;
2526
import static org.elasticsearch.xpack.inference.services.elastic.ElasticInferenceServiceSettings.PERIODIC_AUTHORIZATION_ENABLED;
2627
import static org.hamcrest.Matchers.is;
@@ -58,7 +59,7 @@ public void testUpgradeAuthorizationTaskExecutor() throws Exception {
5859

5960
// If the old cluster already has the feature for the authorization polling task, the task should already exist
6061
// We only want to test when upgrading from a version that does not have the task
61-
if (oldClusterHasFeature(BEFORE_AUTHORIZATION_TASK_FEATURE) == false) {
62+
if (oldClusterHasFeature(INFERENCE_AUTH_POLLER_PERSISTENT_TASK) == false) {
6263
if (isOldCluster()) {
6364
// if we're on a version prior to the authorization polling task, the task should not be created
6465
assertFalse(doesAuthPollingTaskExist());

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elastic/authorization/AuthorizationTaskExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ private void sendStartRequest(@Nullable ClusterState state) {
148148
persistentTasksService.sendClusterStartRequest(
149149
TASK_NAME,
150150
TASK_NAME,
151-
new AuthorizationTaskParams(),
151+
AuthorizationTaskParams.INSTANCE,
152152
TimeValue.THIRTY_SECONDS,
153153
ActionListener.wrap(
154154
persistentTask -> logger.info("Finished creating authorization poller task, id {}", persistentTask.getId()),

0 commit comments

Comments
 (0)