Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKatsoulis committed Mar 17, 2022
1 parent 24c8f8b commit 31436d0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ export const OnPremInstructions: React.FC = () => {
className="eui-textLeft"
steps={[
AgentPolicySelectionStep({ policyId, setPolicyId }),
DownloadStep(true, '', ''),
DownloadStep(true),
deploymentModeStep({ deploymentMode, setDeploymentMode }),
addFleetServerHostStep({ addFleetServerHost }),
ServiceTokenStep({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export const StandaloneInstructions = React.memo<InstructionProps>(
refreshAgentPolicies,
})
: undefined,
DownloadStep(false, '', ''),
DownloadStep(false),
{
title: i18n.translate('xpack.fleet.agentEnrollment.stepConfigureAgentTitle', {
defaultMessage: 'Configure the agent',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { sendGetK8sManifest } from '../../hooks/use_request/k8s';
import { AdvancedAgentAuthenticationSettings } from './advanced_agent_authentication_settings';
import { SelectCreateAgentPolicy } from './agent_policy_select_create';

export const DownloadStep = (hasFleetServer: boolean, isK8s: string, enrollmentAPIKey: string) => {
export const DownloadStep = (hasFleetServer: boolean, isK8s?: string, enrollmentAPIKey?: string) => {
const kibanaVersion = useKibanaVersion();
const core = useStartServices();
const settings = useGetSettings();
Expand Down
44 changes: 23 additions & 21 deletions x-pack/plugins/fleet/server/routes/agent_policy/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,28 +219,28 @@ export const getFullAgentPolicy: FleetRequestHandler<
const soClient = context.fleet.epm.internalSoClient;

if (request.query.kubernetes === true) {
try {
const fullAgentConfigMap = await agentPolicyService.getFullAgentConfigMap(
soClient,
request.params.agentPolicyId,
{ standalone: request.query.standalone === true }
);
if (fullAgentConfigMap) {
const body: GetFullAgentConfigMapResponse = {
item: fullAgentConfigMap,
};
return response.ok({
body,
});
} else {
return response.customError({
statusCode: 404,
body: { message: 'Agent config map not found' },
});
}
} catch (error) {
return defaultIngestErrorHandler({ error, response });
try {
const fullAgentConfigMap = await agentPolicyService.getFullAgentConfigMap(
soClient,
request.params.agentPolicyId,
{ standalone: request.query.standalone === true }
);
if (fullAgentConfigMap) {
const body: GetFullAgentConfigMapResponse = {
item: fullAgentConfigMap,
};
return response.ok({
body,
});
} else {
return response.customError({
statusCode: 404,
body: { message: 'Agent config map not found' },
});
}
} catch (error) {
return defaultIngestErrorHandler({ error, response });
}
} else {
try {
const fullAgentPolicy = await agentPolicyService.getFullAgentPolicy(
Expand Down Expand Up @@ -330,6 +330,7 @@ export const downloadFullAgentPolicy: FleetRequestHandler<
};

export const getK8sManifest: FleetRequestHandler<
undefined,
TypeOf<typeof GetK8sManifestRequestSchema.query>
> = async (context, request, response) => {
try {
Expand All @@ -355,6 +356,7 @@ export const getK8sManifest: FleetRequestHandler<
};

export const downloadK8sManifest: FleetRequestHandler<
undefined,
TypeOf<typeof GetK8sManifestRequestSchema.query>
> = async (context, request, response) => {
try {
Expand Down

0 comments on commit 31436d0

Please sign in to comment.