diff --git a/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/components/page_steps/install_agent/install_agent_managed.tsx b/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/components/page_steps/install_agent/install_agent_managed.tsx index 003ad8baf2e4a..4226ba45fb488 100644 --- a/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/components/page_steps/install_agent/install_agent_managed.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/components/page_steps/install_agent/install_agent_managed.tsx @@ -10,11 +10,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText, EuiLink, EuiSteps, EuiSpacer, EuiLoadingSpinner } from '@elastic/eui'; import { Error } from '../../../../../../../components'; -import { - useStartServices, - useAgentVersion, - useShowCompleteAgentInstructions, -} from '../../../../../../../../../hooks'; +import { useStartServices, useAgentVersion } from '../../../../../../../../../hooks'; import { CreatePackagePolicyBottomBar, NotObscuredByBottomBar } from '../..'; import { @@ -54,9 +50,6 @@ export const InstallElasticAgentManagedPageStep: React.FC const [commandCopied, setCommandCopied] = useState(false); const [applyCommandCopied, setApplyCommandCopied] = useState(false); - const { onChangeShowCompleteAgentInstructions, showCompleteAgentInstructions } = - useShowCompleteAgentInstructions(); - if (!enrollmentAPIKey) { return ( fleetServerHost, agentVersion: agentVersion || '', showInstallServers, - showCompleteAgentInstructions, }); const steps = [ @@ -97,8 +89,6 @@ export const InstallElasticAgentManagedPageStep: React.FC fleetServerHost, onCopy: () => setCommandCopied(true), rootIntegrations: getRootIntegrations(agentPolicy?.package_policies ?? []), - onChangeShowCompleteAgentInstructions, - showCompleteAgentInstructions, }), ]; diff --git a/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/components/page_steps/install_agent/install_agent_standalone.tsx b/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/components/page_steps/install_agent/install_agent_standalone.tsx index 5dfb166722381..2802ac1319b15 100644 --- a/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/components/page_steps/install_agent/install_agent_standalone.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/components/page_steps/install_agent/install_agent_standalone.tsx @@ -17,10 +17,7 @@ import { } from '../..'; import { Error as FleetError } from '../../../../../../../components'; -import { - useKibanaVersion, - useShowCompleteAgentInstructions, -} from '../../../../../../../../../hooks'; +import { useKibanaVersion } from '../../../../../../../../../hooks'; import { InstallStandaloneAgentStep, ConfigureStandaloneAgentStep, @@ -41,9 +38,6 @@ export const InstallElasticAgentStandalonePageStep: React.FC setCommandCopied(true), rootIntegrations: getRootIntegrations(agentPolicy?.package_policies ?? []), - onChangeShowCompleteAgentInstructions, - showCompleteAgentInstructions, }), ]; diff --git a/x-pack/platform/plugins/shared/fleet/public/components/agent_enrollment_flyout/steps/compute_steps.tsx b/x-pack/platform/plugins/shared/fleet/public/components/agent_enrollment_flyout/steps/compute_steps.tsx index 2a6488f2ad062..f4795850332ff 100644 --- a/x-pack/platform/plugins/shared/fleet/public/components/agent_enrollment_flyout/steps/compute_steps.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/components/agent_enrollment_flyout/steps/compute_steps.tsx @@ -17,12 +17,7 @@ import { getGcpIntegrationDetailsFromAgentPolicy } from '../../cloud_security_po import { StandaloneInstructions, ManualInstructions } from '../../enrollment_instructions'; -import { - useGetOneEnrollmentAPIKey, - useStartServices, - useAgentVersion, - useShowCompleteAgentInstructions, -} from '../../../hooks'; +import { useGetOneEnrollmentAPIKey, useStartServices, useAgentVersion } from '../../../hooks'; import { useFetchFullPolicy } from '../hooks'; import type { InstructionProps } from '../types'; @@ -66,9 +61,6 @@ export const StandaloneSteps: React.FunctionComponent = ({ isK8s ); - const { showCompleteAgentInstructions, onChangeShowCompleteAgentInstructions } = - useShowCompleteAgentInstructions(); - const agentVersion = useAgentVersion(); const instructionsSteps = useMemo(() => { @@ -76,7 +68,6 @@ export const StandaloneSteps: React.FunctionComponent = ({ agentVersion: agentVersion || '', downloadSource, downloadSourceProxy, - showCompleteAgentInstructions, }); const steps: EuiContainedStepProps[] = !agentPolicy @@ -116,8 +107,6 @@ export const StandaloneSteps: React.FunctionComponent = ({ isK8s, cloudSecurityIntegration, rootIntegrations: getRootIntegrations(selectedPolicy?.package_policies ?? []), - showCompleteAgentInstructions, - onChangeShowCompleteAgentInstructions, }) ); @@ -143,8 +132,6 @@ export const StandaloneSteps: React.FunctionComponent = ({ cloudSecurityIntegration, mode, setMode, - showCompleteAgentInstructions, - onChangeShowCompleteAgentInstructions, ]); if (!agentVersion) { @@ -186,8 +173,6 @@ export const ManagedSteps: React.FunctionComponent = ({ const { enrolledAgentIds } = usePollingAgentCount(selectedPolicy?.id || ''); const agentVersion = useAgentVersion(); - const { showCompleteAgentInstructions, onChangeShowCompleteAgentInstructions } = - useShowCompleteAgentInstructions(); const { gcpProjectId, gcpOrganizationId, gcpAccountType } = getGcpIntegrationDetailsFromAgentPolicy(selectedPolicy); @@ -205,7 +190,6 @@ export const ManagedSteps: React.FunctionComponent = ({ gcpOrganizationId, gcpAccountType, showInstallServers, - showCompleteAgentInstructions, }); const instructionsSteps = useMemo(() => { @@ -275,8 +259,6 @@ export const ManagedSteps: React.FunctionComponent = ({ fleetServerHost, enrollToken, rootIntegrations: getRootIntegrations(selectedPolicy?.package_policies ?? []), - showCompleteAgentInstructions, - onChangeShowCompleteAgentInstructions, }) ); } @@ -328,8 +310,6 @@ export const ManagedSteps: React.FunctionComponent = ({ agentDataConfirmed, installedPackagePolicy, gcpProjectId, - showCompleteAgentInstructions, - onChangeShowCompleteAgentInstructions, ]); if (!agentVersion) { diff --git a/x-pack/platform/plugins/shared/fleet/public/components/agent_enrollment_flyout/steps/install_managed_agent_step.tsx b/x-pack/platform/plugins/shared/fleet/public/components/agent_enrollment_flyout/steps/install_managed_agent_step.tsx index 9a1d638a7c7a4..566d73aff7fc9 100644 --- a/x-pack/platform/plugins/shared/fleet/public/components/agent_enrollment_flyout/steps/install_managed_agent_step.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/components/agent_enrollment_flyout/steps/install_managed_agent_step.tsx @@ -11,8 +11,6 @@ import { i18n } from '@kbn/i18n'; import type { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps'; -import type { EuiSwitchProps } from '@elastic/eui'; - import type { GetOneEnrollmentAPIKeyResponse } from '../../../../common/types/rest_spec/enrollment_api_key'; import { InstallSection } from '../../enrollment_instructions/install_section'; @@ -32,8 +30,6 @@ export const InstallManagedAgentStep = ({ fullCopyButton, onCopy, rootIntegrations, - showCompleteAgentInstructions, - onChangeShowCompleteAgentInstructions, }: { selectedApiKeyId?: string; apiKeyData?: GetOneEnrollmentAPIKeyResponse | null; @@ -46,8 +42,6 @@ export const InstallManagedAgentStep = ({ fullCopyButton?: boolean; onCopy?: () => void; rootIntegrations?: Array<{ name: string; title: string }>; - showCompleteAgentInstructions: boolean; - onChangeShowCompleteAgentInstructions: EuiSwitchProps['onChange']; }): EuiContainedStepProps => { const nonCompleteStatus = selectedApiKeyId ? undefined : 'disabled'; const status = isComplete ? 'complete' : nonCompleteStatus; @@ -67,8 +61,6 @@ export const InstallManagedAgentStep = ({ fullCopyButton={fullCopyButton} fleetServerHost={fleetServerHost} rootIntegrations={rootIntegrations} - showCompleteAgentInstructions={showCompleteAgentInstructions} - onChangeShowCompleteAgentInstructions={onChangeShowCompleteAgentInstructions} /> ) : ( diff --git a/x-pack/platform/plugins/shared/fleet/public/components/agent_enrollment_flyout/steps/install_standalone_agent_step.tsx b/x-pack/platform/plugins/shared/fleet/public/components/agent_enrollment_flyout/steps/install_standalone_agent_step.tsx index 010d70760ddfe..2e11cc165d4f7 100644 --- a/x-pack/platform/plugins/shared/fleet/public/components/agent_enrollment_flyout/steps/install_standalone_agent_step.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/components/agent_enrollment_flyout/steps/install_standalone_agent_step.tsx @@ -10,8 +10,6 @@ import { i18n } from '@kbn/i18n'; import type { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps'; -import type { EuiSwitchProps } from '@elastic/eui'; - import type { CommandsByPlatform } from '../../../applications/fleet/components/fleet_server_instructions/utils/install_command_utils'; import { InstallSection } from '../../enrollment_instructions/install_section'; @@ -26,8 +24,6 @@ export const InstallStandaloneAgentStep = ({ fullCopyButton, onCopy, rootIntegrations, - showCompleteAgentInstructions, - onChangeShowCompleteAgentInstructions, }: { installCommand: CommandsByPlatform; isK8s?: K8sMode; @@ -36,8 +32,6 @@ export const InstallStandaloneAgentStep = ({ fullCopyButton?: boolean; onCopy?: () => void; rootIntegrations?: Array<{ name: string; title: string }>; - showCompleteAgentInstructions: boolean; - onChangeShowCompleteAgentInstructions: EuiSwitchProps['onChange']; }): EuiContainedStepProps => { return { title: i18n.translate('xpack.fleet.agentEnrollment.stepEnrollAndRunAgentTitle', { @@ -52,8 +46,6 @@ export const InstallStandaloneAgentStep = ({ fullCopyButton={fullCopyButton} isManaged={false} rootIntegrations={rootIntegrations} - showCompleteAgentInstructions={showCompleteAgentInstructions} - onChangeShowCompleteAgentInstructions={onChangeShowCompleteAgentInstructions} /> ), status: isComplete ? 'complete' : undefined, diff --git a/x-pack/platform/plugins/shared/fleet/public/components/enrollment_instructions/install_section.tsx b/x-pack/platform/plugins/shared/fleet/public/components/enrollment_instructions/install_section.tsx index 1addbdc841d87..e3b1de2b2985f 100644 --- a/x-pack/platform/plugins/shared/fleet/public/components/enrollment_instructions/install_section.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/components/enrollment_instructions/install_section.tsx @@ -7,11 +7,6 @@ import React from 'react'; -import type { EuiSwitchProps } from '@elastic/eui'; -import { EuiFlexGroup, EuiIcon, EuiSpacer, EuiSwitch, EuiToolTip } from '@elastic/eui'; - -import { i18n } from '@kbn/i18n'; - import type { CommandsByPlatform } from '../../applications/fleet/components/fleet_server_instructions/utils'; import { InstallationMessage } from '../agent_enrollment_flyout/installation_message'; @@ -32,8 +27,6 @@ interface Props { isManaged?: boolean; onCopy?: () => void; rootIntegrations?: Array<{ name: string; title: string }>; - showCompleteAgentInstructions: boolean; - onChangeShowCompleteAgentInstructions: EuiSwitchProps['onChange']; } export const InstallSection: React.FunctionComponent = ({ @@ -46,26 +39,12 @@ export const InstallSection: React.FunctionComponent = ({ isManaged = true, onCopy, rootIntegrations, - showCompleteAgentInstructions, - onChangeShowCompleteAgentInstructions, }) => { return ( <> - - - - - - - = ({ ); }; - -const addElasticAgentCompleteLabel = i18n.translate( - 'xpack.fleet.enrollmentInstructions.completeAgent.label', - { - defaultMessage: 'Use the elastic-agent-complete docker image', - } -); - -const addElasticAgentCompleteTooltipContent = i18n.translate( - 'xpack.fleet.enrollmentInstructions.completeAgent.tooltip', - { - defaultMessage: 'Required to run Synthetics browser tests', - } -); diff --git a/x-pack/platform/plugins/shared/fleet/public/components/enrollment_instructions/manual/index.tsx b/x-pack/platform/plugins/shared/fleet/public/components/enrollment_instructions/manual/index.tsx index 3fb2f2019a213..45c4d6024504a 100644 --- a/x-pack/platform/plugins/shared/fleet/public/components/enrollment_instructions/manual/index.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/components/enrollment_instructions/manual/index.tsx @@ -83,7 +83,6 @@ export const ManualInstructions = ({ gcpOrganizationId = '', gcpAccountType, showInstallServers, - showCompleteAgentInstructions = false, }: { apiKey: string; fleetServerHost: string; @@ -95,7 +94,6 @@ export const ManualInstructions = ({ gcpOrganizationId?: string; gcpAccountType?: string; showInstallServers?: boolean; - showCompleteAgentInstructions?: boolean; }) => { const getEnrollArgsByPlatForm = (platform: EXTENDED_PLATFORM_TYPE) => { return getFleetServerHostsEnrollArgs({ @@ -106,69 +104,65 @@ export const ManualInstructions = ({ showInstallServers, }); }; - - const elasticAgentName = showCompleteAgentInstructions - ? 'elastic-agent-complete' - : 'elastic-agent'; - const downloadBaseUrl = getDownloadBaseUrl(downloadSource); - const k8sCommand = `kubectl apply -f ${elasticAgentName}-managed-kubernetes.yml`; + const k8sCommand = 'kubectl apply -f elastic-agent-managed-kubernetes.yml'; const { windows: windowsDownloadSourceProxyArgs, curl: curlDownloadSourceProxyArgs } = getDownloadSourceProxyArgs(downloadSourceProxy); + const debOrRpmWithInstallServers = showInstallServers ? `ELASTIC_AGENT_FLAVOR=servers ` : ''; - const linuxAarch64Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-linux-arm64.tar.gz ${curlDownloadSourceProxyArgs} - tar xzvf ${elasticAgentName}-${agentVersion}-linux-arm64.tar.gz - cd ${elasticAgentName}-${agentVersion}-linux-arm64 + const linuxAarch64Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-linux-arm64.tar.gz ${curlDownloadSourceProxyArgs} + tar xzvf elastic-agent-${agentVersion}-linux-arm64.tar.gz + cd elastic-agent-${agentVersion}-linux-arm64 sudo ./elastic-agent install ${getEnrollArgsByPlatForm('linux_aarch64')}`; - const linuxX8664Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-linux-x86_64.tar.gz ${curlDownloadSourceProxyArgs} -tar xzvf ${elasticAgentName}-${agentVersion}-linux-x86_64.tar.gz -cd ${elasticAgentName}-${agentVersion}-linux-x86_64 + const linuxX8664Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-linux-x86_64.tar.gz ${curlDownloadSourceProxyArgs} +tar xzvf elastic-agent-${agentVersion}-linux-x86_64.tar.gz +cd elastic-agent-${agentVersion}-linux-x86_64 sudo ./elastic-agent install ${getEnrollArgsByPlatForm('linux_x86_64')}`; - const macAarch64Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-darwin-aarch64.tar.gz ${curlDownloadSourceProxyArgs} -tar xzvf ${elasticAgentName}-${agentVersion}-darwin-aarch64.tar.gz -cd ${elasticAgentName}-${agentVersion}-darwin-aarch64 + const macAarch64Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-darwin-aarch64.tar.gz ${curlDownloadSourceProxyArgs} +tar xzvf elastic-agent-${agentVersion}-darwin-aarch64.tar.gz +cd elastic-agent-${agentVersion}-darwin-aarch64 sudo ./elastic-agent install ${getEnrollArgsByPlatForm('mac_aarch64')}`; - const macX8664Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-darwin-x86_64.tar.gz ${curlDownloadSourceProxyArgs} -tar xzvf ${elasticAgentName}-${agentVersion}-darwin-x86_64.tar.gz -cd ${elasticAgentName}-${agentVersion}-darwin-x86_64 + const macX8664Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-darwin-x86_64.tar.gz ${curlDownloadSourceProxyArgs} +tar xzvf elastic-agent-${agentVersion}-darwin-x86_64.tar.gz +cd elastic-agent-${agentVersion}-darwin-x86_64 sudo ./elastic-agent install ${getEnrollArgsByPlatForm('mac_x86_64')}`; const windowsCommand = `$ProgressPreference = 'SilentlyContinue' -Invoke-WebRequest -Uri ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-windows-x86_64.zip -OutFile ${elasticAgentName}-${agentVersion}-windows-x86_64.zip ${windowsDownloadSourceProxyArgs} -Expand-Archive .\\${elasticAgentName}-${agentVersion}-windows-x86_64.zip -DestinationPath . -cd ${elasticAgentName}-${agentVersion}-windows-x86_64 +Invoke-WebRequest -Uri ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-windows-x86_64.zip -OutFile elastic-agent-${agentVersion}-windows-x86_64.zip ${windowsDownloadSourceProxyArgs} +Expand-Archive .\\elastic-agent-${agentVersion}-windows-x86_64.zip -DestinationPath . +cd elastic-agent-${agentVersion}-windows-x86_64 .\\elastic-agent.exe install ${getEnrollArgsByPlatForm('windows')}`; const windowsMSICommand = `$ProgressPreference = 'SilentlyContinue' -Invoke-WebRequest -Uri ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-windows-x86_64.msi -OutFile ${elasticAgentName}-${agentVersion}-windows-x86_64.msi ${windowsDownloadSourceProxyArgs} +Invoke-WebRequest -Uri ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-windows-x86_64.msi -OutFile elastic-agent-${agentVersion}-windows-x86_64.msi ${windowsDownloadSourceProxyArgs} .\\elastic-agent.msi --% INSTALLARGS="${getEnrollArgsByPlatForm('windows_msi')}"`; - const linuxDebAarch64Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-arm64.deb ${curlDownloadSourceProxyArgs} -sudo ${debOrRpmWithInstallServers}dpkg -i ${elasticAgentName}-${agentVersion}-arm64.deb + const linuxDebAarch64Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-arm64.deb ${curlDownloadSourceProxyArgs} +sudo ${debOrRpmWithInstallServers}dpkg -i elastic-agent-${agentVersion}-arm64.deb sudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent \nsudo elastic-agent enroll ${getEnrollArgsByPlatForm( 'deb_aarch64' )} \n`; - const linuxDebX8664Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-amd64.deb ${curlDownloadSourceProxyArgs} -sudo ${debOrRpmWithInstallServers}dpkg -i ${elasticAgentName}-${agentVersion}-amd64.deb + const linuxDebX8664Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-amd64.deb ${curlDownloadSourceProxyArgs} +sudo ${debOrRpmWithInstallServers}dpkg -i elastic-agent-${agentVersion}-amd64.deb sudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent \nsudo elastic-agent enroll ${getEnrollArgsByPlatForm( 'deb_x86_64' )} \n`; - const linuxRpmAarch64Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-aarch64.rpm ${curlDownloadSourceProxyArgs} -sudo ${debOrRpmWithInstallServers}rpm -vi ${elasticAgentName}-${agentVersion}-aarch64.rpm + const linuxRpmAarch64Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-aarch64.rpm ${curlDownloadSourceProxyArgs} +sudo ${debOrRpmWithInstallServers}rpm -vi elastic-agent-${agentVersion}-aarch64.rpm sudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent \nsudo elastic-agent enroll ${getEnrollArgsByPlatForm( 'rpm_aarch64' )} \n`; - const linuxRpmX8664Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-x86_64.rpm ${curlDownloadSourceProxyArgs} -sudo ${debOrRpmWithInstallServers}rpm -vi ${elasticAgentName}-${agentVersion}-x86_64.rpm + const linuxRpmX8664Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-x86_64.rpm ${curlDownloadSourceProxyArgs} +sudo ${debOrRpmWithInstallServers}rpm -vi elastic-agent-${agentVersion}-x86_64.rpm sudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent \nsudo elastic-agent enroll ${getEnrollArgsByPlatForm( 'rpm_x86_64' )} \n`; diff --git a/x-pack/platform/plugins/shared/fleet/public/components/enrollment_instructions/standalone/index.tsx b/x-pack/platform/plugins/shared/fleet/public/components/enrollment_instructions/standalone/index.tsx index 54e6fbe7686f3..9bf9ba8c3127a 100644 --- a/x-pack/platform/plugins/shared/fleet/public/components/enrollment_instructions/standalone/index.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/components/enrollment_instructions/standalone/index.tsx @@ -13,64 +13,58 @@ export const StandaloneInstructions = ({ agentVersion, downloadSource, downloadSourceProxy, - showCompleteAgentInstructions, }: { agentVersion: string; downloadSource?: DownloadSource; downloadSourceProxy?: FleetProxy; - showCompleteAgentInstructions: boolean; }): CommandsByPlatform => { - const elasticAgentName = showCompleteAgentInstructions - ? 'elastic-agent-complete' - : 'elastic-agent'; - const downloadBaseUrl = getDownloadBaseUrl(downloadSource); const { windows: windowsDownloadSourceProxyArgs, curl: curlDownloadSourceProxyArgs } = getDownloadSourceProxyArgs(downloadSourceProxy); - const linuxDebAarch64Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-arm64.deb ${curlDownloadSourceProxyArgs} -sudo dpkg -i ${elasticAgentName}-${agentVersion}-arm64.deb \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`; + const linuxDebAarch64Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-arm64.deb ${curlDownloadSourceProxyArgs} +sudo dpkg -i elastic-agent-${agentVersion}-arm64.deb \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`; - const linuxDebX8664Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-amd64.deb ${curlDownloadSourceProxyArgs} -sudo dpkg -i ${elasticAgentName}-${agentVersion}-amd64.deb \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`; + const linuxDebX8664Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-amd64.deb ${curlDownloadSourceProxyArgs} +sudo dpkg -i elastic-agent-${agentVersion}-amd64.deb \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`; - const linuxRpmAarch64Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-aarch64.rpm ${curlDownloadSourceProxyArgs} -sudo rpm -vi ${elasticAgentName}-${agentVersion}-aarch64.rpm \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`; + const linuxRpmAarch64Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-aarch64.rpm ${curlDownloadSourceProxyArgs} +sudo rpm -vi elastic-agent-${agentVersion}-aarch64.rpm \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`; - const linuxRpmX8664Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-x86_64.rpm ${curlDownloadSourceProxyArgs} -sudo rpm -vi ${elasticAgentName}-${agentVersion}-x86_64.rpm \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`; + const linuxRpmX8664Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-x86_64.rpm ${curlDownloadSourceProxyArgs} +sudo rpm -vi elastic-agent-${agentVersion}-x86_64.rpm \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`; - const linuxAarch64Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-linux-arm64.tar.gz ${curlDownloadSourceProxyArgs} -tar xzvf ${elasticAgentName}-${agentVersion}-linux-arm64.tar.gz -cd ${elasticAgentName}-${agentVersion}-linux-arm64 + const linuxAarch64Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-linux-arm64.tar.gz ${curlDownloadSourceProxyArgs} +tar xzvf elastic-agent-${agentVersion}-linux-arm64.tar.gz +cd elastic-agent-${agentVersion}-linux-arm64 sudo ./elastic-agent install`; - const linuxX8664Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-linux-x86_64.tar.gz ${curlDownloadSourceProxyArgs} -tar xzvf ${elasticAgentName}-${agentVersion}-linux-x86_64.tar.gz -cd ${elasticAgentName}-${agentVersion}-linux-x86_64 + const linuxX8664Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-linux-x86_64.tar.gz ${curlDownloadSourceProxyArgs} +tar xzvf elastic-agent-${agentVersion}-linux-x86_64.tar.gz +cd elastic-agent-${agentVersion}-linux-x86_64 sudo ./elastic-agent install`; - const macAarch64Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-darwin-aarch64.tar.gz ${curlDownloadSourceProxyArgs} -tar xzvf ${elasticAgentName}-${agentVersion}-darwin-aarch64.tar.gz -cd ${elasticAgentName}-${agentVersion}-darwin-aarch64 + const macAarch64Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-darwin-aarch64.tar.gz ${curlDownloadSourceProxyArgs} +tar xzvf elastic-agent-${agentVersion}-darwin-aarch64.tar.gz +cd elastic-agent-${agentVersion}-darwin-aarch64 sudo ./elastic-agent install`; - const macX8664Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-darwin-x86_64.tar.gz ${curlDownloadSourceProxyArgs} -tar xzvf ${elasticAgentName}-${agentVersion}-darwin-x86_64.tar.gz -cd ${elasticAgentName}-${agentVersion}-darwin-x86_64 + const macX8664Command = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-darwin-x86_64.tar.gz ${curlDownloadSourceProxyArgs} +tar xzvf elastic-agent-${agentVersion}-darwin-x86_64.tar.gz +cd elastic-agent-${agentVersion}-darwin-x86_64 sudo ./elastic-agent install`; const windowsCommand = `$ProgressPreference = 'SilentlyContinue' -Invoke-WebRequest -Uri ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-windows-x86_64.zip -OutFile ${elasticAgentName}-${agentVersion}-windows-x86_64.zip ${windowsDownloadSourceProxyArgs} -Expand-Archive .\${elasticAgentName}-${agentVersion}-windows-x86_64.zip -DestinationPath . -cd ${elasticAgentName}-${agentVersion}-windows-x86_64 +Invoke-WebRequest -Uri ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-windows-x86_64.zip -OutFile elastic-agent-${agentVersion}-windows-x86_64.zip ${windowsDownloadSourceProxyArgs} +Expand-Archive .\elastic-agent-${agentVersion}-windows-x86_64.zip -DestinationPath . +cd elastic-agent-${agentVersion}-windows-x86_64 .\\elastic-agent.exe install`; const windowsMSICommand = `$ProgressPreference = 'SilentlyContinue' -Invoke-WebRequest -Uri ${downloadBaseUrl}/beats/elastic-agent/${elasticAgentName}-${agentVersion}-windows-x86_64.msi -OutFile ${elasticAgentName}-${agentVersion}-windows-x86_64.msi ${windowsDownloadSourceProxyArgs} +Invoke-WebRequest -Uri ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-windows-x86_64.msi -OutFile elastic-agent-${agentVersion}-windows-x86_64.msi ${windowsDownloadSourceProxyArgs} .\\elastic-agent.msi install`; - const k8sCommand = `kubectl apply -f ${elasticAgentName}-standalone-kubernetes.yml`; + const k8sCommand = 'kubectl apply -f elastic-agent-standalone-kubernetes.yml'; return { linux_aarch64: linuxAarch64Command, diff --git a/x-pack/platform/plugins/shared/fleet/public/hooks/index.ts b/x-pack/platform/plugins/shared/fleet/public/hooks/index.ts index bce6b5b58b464..f537698897a19 100644 --- a/x-pack/platform/plugins/shared/fleet/public/hooks/index.ts +++ b/x-pack/platform/plugins/shared/fleet/public/hooks/index.ts @@ -35,4 +35,3 @@ export * from './use_locator'; export * from './use_agent_version'; export * from './use_fleet_server_agents'; export * from './use_multiple_agent_policies'; -export * from './use_show_complete_agent_instructions'; diff --git a/x-pack/platform/plugins/shared/fleet/public/hooks/use_show_complete_agent_instructions.ts b/x-pack/platform/plugins/shared/fleet/public/hooks/use_show_complete_agent_instructions.ts deleted file mode 100644 index f6e6613169f91..0000000000000 --- a/x-pack/platform/plugins/shared/fleet/public/hooks/use_show_complete_agent_instructions.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { useState } from 'react'; - -export const useShowCompleteAgentInstructions = () => { - const [showCompleteAgentInstructions, setShowCompleteAgentInstructions] = useState(false); - const onChangeShowCompleteAgentInstructions = (e: { - target: { checked: React.SetStateAction }; - }) => { - setShowCompleteAgentInstructions(e.target.checked); - }; - - return { showCompleteAgentInstructions, onChangeShowCompleteAgentInstructions }; -};