mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Fleet] Avoid to create cloud fleet server hosts in serverless (#163185)
This commit is contained in:
parent
4d8bf22d79
commit
9377ae708e
2 changed files with 23 additions and 1 deletions
|
@ -112,6 +112,23 @@ describe('getCloudFleetServersHosts', () => {
|
|||
expect(getCloudFleetServersHosts()).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should return fleet server hosts if cloud is correctly setup in serverless', () => {
|
||||
mockedAppContextService.getCloud.mockReturnValue({
|
||||
cloudId:
|
||||
'dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRjZWM2ZjI2MWE3NGJmMjRjZTMzYmI4ODExYjg0Mjk0ZiRjNmMyY2E2ZDA0MjI0OWFmMGNjN2Q3YTllOTYyNTc0Mw==',
|
||||
isCloudEnabled: true,
|
||||
deploymentId: 'deployment-id-1',
|
||||
cloudHost: 'us-east-1.aws.found.io',
|
||||
apm: {},
|
||||
isServerlessEnabled: true,
|
||||
serverless: {
|
||||
projectId: undefined,
|
||||
},
|
||||
});
|
||||
|
||||
expect(getCloudFleetServersHosts()).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should return fleet server hosts if cloud is correctly setup with default port == 443', () => {
|
||||
mockedAppContextService.getCloud.mockReturnValue({
|
||||
cloudId:
|
||||
|
|
|
@ -27,7 +27,12 @@ import { isDifferent } from './utils';
|
|||
|
||||
export function getCloudFleetServersHosts() {
|
||||
const cloudSetup = appContextService.getCloud();
|
||||
if (cloudSetup && cloudSetup.isCloudEnabled && cloudSetup.cloudHost) {
|
||||
if (
|
||||
cloudSetup &&
|
||||
!cloudSetup.isServerlessEnabled &&
|
||||
cloudSetup.isCloudEnabled &&
|
||||
cloudSetup.cloudHost
|
||||
) {
|
||||
// Fleet Server url are formed like this `https://<deploymentId>.fleet.<host>
|
||||
return [
|
||||
`https://${cloudSetup.deploymentId}.fleet.${cloudSetup.cloudHost}${
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue