Skip to content

Commit 8fc6b7e

Browse files
authored
[Alerting] change eventLog ILM requests to absolute URLs (#68331) (#68391)
resolves #68265 This changes the ILM requests made by the eventLog from relative to absolute URLs. These requests test the existence of and create ILM policies, and are made with a cluster client using `transport.request`. Relative URLs work fine locally and in CI, however do not work on the cloud.
1 parent b770327 commit 8fc6b7e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

x-pack/plugins/event_log/server/es/cluster_client_adapter.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('doesIlmPolicyExist', () => {
5151
await clusterClientAdapter.doesIlmPolicyExist('foo');
5252
expect(clusterClient.callAsInternalUser).toHaveBeenCalledWith('transport.request', {
5353
method: 'GET',
54-
path: '_ilm/policy/foo',
54+
path: '/_ilm/policy/foo',
5555
});
5656
});
5757

@@ -78,7 +78,7 @@ describe('createIlmPolicy', () => {
7878
await clusterClientAdapter.createIlmPolicy('foo', { args: true });
7979
expect(clusterClient.callAsInternalUser).toHaveBeenCalledWith('transport.request', {
8080
method: 'PUT',
81-
path: '_ilm/policy/foo',
81+
path: '/_ilm/policy/foo',
8282
body: { args: true },
8383
});
8484
});

x-pack/plugins/event_log/server/es/cluster_client_adapter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class ClusterClientAdapter {
4141
public async doesIlmPolicyExist(policyName: string): Promise<boolean> {
4242
const request = {
4343
method: 'GET',
44-
path: `_ilm/policy/${policyName}`,
44+
path: `/_ilm/policy/${policyName}`,
4545
};
4646
try {
4747
await this.callEs('transport.request', request);
@@ -55,7 +55,7 @@ export class ClusterClientAdapter {
5555
public async createIlmPolicy(policyName: string, policy: unknown): Promise<void> {
5656
const request = {
5757
method: 'PUT',
58-
path: `_ilm/policy/${policyName}`,
58+
path: `/_ilm/policy/${policyName}`,
5959
body: policy,
6060
};
6161
try {

0 commit comments

Comments
 (0)