[Alerting] change eventLog ILM requests to absolute URLs (#68331)

resolves https://github.com/elastic/kibana/issues/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.
This commit is contained in:
Patrick Mueller 2020-06-05 11:04:03 -04:00 committed by GitHub
parent 6f57fa0b2d
commit e57f92549b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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',
});
});
@ -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 },
});
});

View file

@ -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);
@ -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 {