Skip to content

Commit

Permalink
[Alerting] change eventLog ILM requests to absolute URLs
Browse files Browse the repository at this point in the history
resolves elastic#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.
  • Loading branch information
pmuellr committed Jun 4, 2020
1 parent a4549a7 commit 63e17cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('doesIlmPolicyExist', () => {
await clusterClientAdapter.doesIlmPolicyExist('foo');
expect(clusterClient.callAsInternalUser).toHaveBeenCalledWith('transport.request', {
method: 'GET',
path: '_ilm/policy/foo',
path: '/_ilm/policy/foo',
});
});

Expand All @@ -78,7 +78,7 @@ describe('createIlmPolicy', () => {
await clusterClientAdapter.createIlmPolicy('foo', { args: true });
expect(clusterClient.callAsInternalUser).toHaveBeenCalledWith('transport.request', {
method: 'PUT',
path: '_ilm/policy/foo',
path: '/_ilm/policy/foo',
body: { args: true },
});
});
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/event_log/server/es/cluster_client_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class ClusterClientAdapter {
public async doesIlmPolicyExist(policyName: string): Promise<boolean> {
const request = {
method: 'GET',
path: `_ilm/policy/${policyName}`,
path: `/_ilm/policy/${policyName}`,
};
try {
await this.callEs('transport.request', request);
Expand All @@ -55,7 +55,7 @@ export class ClusterClientAdapter {
public async createIlmPolicy(policyName: string, policy: unknown): Promise<void> {
const request = {
method: 'PUT',
path: `_ilm/policy/${policyName}`,
path: `/_ilm/policy/${policyName}`,
body: policy,
};
try {
Expand Down

0 comments on commit 63e17cf

Please sign in to comment.