mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Fleet] Use default port for fleet server cloud url (#98492)
This commit is contained in:
parent
aa281ffad7
commit
52a90e3dc9
2 changed files with 22 additions and 2 deletions
|
@ -17,7 +17,7 @@ describe('getCloudFleetServersHosts', () => {
|
|||
expect(getCloudFleetServersHosts()).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should return fleet server hosts if cloud is correctly setup', () => {
|
||||
it('should return fleet server hosts if cloud is correctly setup with default port == 443', () => {
|
||||
mockedAppContextService.getCloud.mockReturnValue({
|
||||
cloudId:
|
||||
'dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRjZWM2ZjI2MWE3NGJmMjRjZTMzYmI4ODExYjg0Mjk0ZiRjNmMyY2E2ZDA0MjI0OWFmMGNjN2Q3YTllOTYyNTc0Mw==',
|
||||
|
@ -32,4 +32,20 @@ describe('getCloudFleetServersHosts', () => {
|
|||
]
|
||||
`);
|
||||
});
|
||||
|
||||
it('should return fleet server hosts if cloud is correctly setup with a default port', () => {
|
||||
mockedAppContextService.getCloud.mockReturnValue({
|
||||
cloudId:
|
||||
'test:dGVzdC5mcjo5MjQzJGRhM2I2YjNkYWY5ZDRjODE4ZjI4ZmEzNDdjMzgzODViJDgxMmY4NWMxZjNjZTQ2YTliYjgxZjFjMWIxMzRjNmRl',
|
||||
isCloudEnabled: true,
|
||||
deploymentId: 'deployment-id-1',
|
||||
apm: {},
|
||||
});
|
||||
|
||||
expect(getCloudFleetServersHosts()).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
"https://deployment-id-1.fleet.test.fr:9243",
|
||||
]
|
||||
`);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -84,6 +84,10 @@ export function getCloudFleetServersHosts() {
|
|||
}
|
||||
|
||||
// Fleet Server url are formed like this `https://<deploymentId>.fleet.<host>
|
||||
return [`https://${cloudSetup.deploymentId}.fleet.${res.host}`];
|
||||
return [
|
||||
`https://${cloudSetup.deploymentId}.fleet.${res.host}${
|
||||
res.defaultPort !== '443' ? `:${res.defaultPort}` : ''
|
||||
}`,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue