Skip to content

Commit

Permalink
[Fleet] Do not provide instruction to setup an http Fleet server (#12…
Browse files Browse the repository at this point in the history
…9371) (#129756)

(cherry picked from commit eff1e0c)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
  • Loading branch information
kibanamachine and nchaulet authored Apr 7, 2022
1 parent b7538d8 commit 689af7e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('Fleet startup', () => {
cy.getBySel('agentPolicyDropdown');

// verify fleet server enroll command contains created policy id
cy.getBySel('fleetServerHostInput').type('http://localhost:8220');
cy.getBySel('fleetServerHostInput').type('https://localhost:8220');
cy.getBySel('fleetServerAddHostBtn').click();
cy.getBySel('fleetServerGenerateServiceTokenBtn').click();
cy.get('.euiCodeBlock__code').contains('--fleet-server-policy=fleet-server-policy');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import { PlatformSelector } from '../../../../../../components/enrollment_instru
import type { CommandsByPlatform } from './install_command_utils';
import { getInstallCommandForPlatform } from './install_command_utils';

const URL_REGEX = /^(https?):\/\/[^\s$.?#].[^\s]*$/gm;
const URL_REGEX = /^(https):\/\/[^\s$.?#].[^\s]*$/gm;
const REFRESH_INTERVAL = 10000;

type DeploymentMode = 'production' | 'quickstart';
Expand Down Expand Up @@ -379,7 +379,7 @@ export const AddFleetServerHostStepContent = ({
} else {
setError(
i18n.translate('xpack.fleet.fleetServerSetup.addFleetServerHostInvalidUrlError', {
defaultMessage: 'Invalid URL',
defaultMessage: 'Valid https URL required.',
})
);
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ describe('getInstallCommandForPlatform', () => {
expect(res.linux).toMatchInlineSnapshot(`
"sudo ./elastic-agent install \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-insecure-http"
--fleet-server-service-token=service-token-1"
`);
});

Expand All @@ -26,8 +25,7 @@ describe('getInstallCommandForPlatform', () => {
expect(res.mac).toMatchInlineSnapshot(`
"sudo ./elastic-agent install \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-insecure-http"
--fleet-server-service-token=service-token-1"
`);
});

Expand All @@ -37,8 +35,7 @@ describe('getInstallCommandForPlatform', () => {
expect(res.windows).toMatchInlineSnapshot(`
".\\\\elastic-agent.exe install \`
--fleet-server-es=http://elasticsearch:9200 \`
--fleet-server-service-token=service-token-1 \`
--fleet-server-insecure-http"
--fleet-server-service-token=service-token-1"
`);
});

Expand All @@ -48,8 +45,7 @@ describe('getInstallCommandForPlatform', () => {
expect(res.rpm).toMatchInlineSnapshot(`
"sudo elastic-agent enroll \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-insecure-http"
--fleet-server-service-token=service-token-1"
`);
});

Expand All @@ -59,8 +55,7 @@ describe('getInstallCommandForPlatform', () => {
expect(res.deb).toMatchInlineSnapshot(`
"sudo elastic-agent enroll \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-insecure-http"
--fleet-server-service-token=service-token-1"
`);
});

Expand All @@ -78,8 +73,7 @@ describe('getInstallCommandForPlatform', () => {
"sudo ./elastic-agent install \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-es-ca-trusted-fingerprint=fingerprint123456 \\\\
--fleet-server-insecure-http"
--fleet-server-es-ca-trusted-fingerprint=fingerprint123456"
`);
});
});
Expand All @@ -96,8 +90,7 @@ describe('getInstallCommandForPlatform', () => {
"sudo ./elastic-agent install \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-policy=policy-1 \\\\
--fleet-server-insecure-http"
--fleet-server-policy=policy-1"
`);
});

Expand All @@ -112,8 +105,7 @@ describe('getInstallCommandForPlatform', () => {
"sudo ./elastic-agent install \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-policy=policy-1 \\\\
--fleet-server-insecure-http"
--fleet-server-policy=policy-1"
`);
});

Expand All @@ -128,8 +120,7 @@ describe('getInstallCommandForPlatform', () => {
".\\\\elastic-agent.exe install \`
--fleet-server-es=http://elasticsearch:9200 \`
--fleet-server-service-token=service-token-1 \`
--fleet-server-policy=policy-1 \`
--fleet-server-insecure-http"
--fleet-server-policy=policy-1"
`);
});

Expand All @@ -144,8 +135,7 @@ describe('getInstallCommandForPlatform', () => {
"sudo elastic-agent enroll \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-policy=policy-1 \\\\
--fleet-server-insecure-http"
--fleet-server-policy=policy-1"
`);
});

Expand All @@ -160,8 +150,7 @@ describe('getInstallCommandForPlatform', () => {
"sudo elastic-agent enroll \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-policy=policy-1 \\\\
--fleet-server-insecure-http"
--fleet-server-policy=policy-1"
`);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ export function getInstallCommandForPlatform(
}
commandArguments.push(['fleet-server-cert', '<PATH_TO_FLEET_SERVER_CERT>']);
commandArguments.push(['fleet-server-cert-key', '<PATH_TO_FLEET_SERVER_CERT_KEY>']);
} else {
commandArguments.push(['fleet-server-insecure-http']);
}

const commandArgumentsStr = (platform?: string) => {
Expand Down

0 comments on commit 689af7e

Please sign in to comment.