mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Fleet] Change log level when fleet server host is not found in the policy (#145005)
This commit is contained in:
parent
38251947e3
commit
6963f577b3
4 changed files with 16 additions and 5 deletions
|
@ -4263,6 +4263,7 @@
|
|||
"type": "boolean"
|
||||
},
|
||||
"fleet_server_hosts": {
|
||||
"deprecated": true,
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
|
|
|
@ -2659,6 +2659,7 @@ components:
|
|||
has_seen_add_data_notice:
|
||||
type: boolean
|
||||
fleet_server_hosts:
|
||||
deprecated: true
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
|
|
|
@ -6,11 +6,12 @@ properties:
|
|||
has_seen_add_data_notice:
|
||||
type: boolean
|
||||
fleet_server_hosts:
|
||||
deprecated: true
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
prerelease_integrations_enabled:
|
||||
type: boolean
|
||||
prerelease_integrations_enabled:
|
||||
type: boolean
|
||||
required:
|
||||
- fleet_server_hosts
|
||||
- id
|
||||
|
|
|
@ -8,7 +8,13 @@
|
|||
import type { SavedObjectsClientContract } from '@kbn/core/server';
|
||||
import { safeLoad } from 'js-yaml';
|
||||
|
||||
import type { FullAgentPolicy, PackagePolicy, Output, FullAgentPolicyOutput } from '../../types';
|
||||
import type {
|
||||
FullAgentPolicy,
|
||||
AgentPolicy,
|
||||
PackagePolicy,
|
||||
Output,
|
||||
FullAgentPolicyOutput,
|
||||
} from '../../types';
|
||||
import { agentPolicyService } from '../agent_policy';
|
||||
import { outputService } from '../output';
|
||||
import { dataTypes, outputType } from '../../../common/constants';
|
||||
|
@ -34,7 +40,7 @@ export async function getFullAgentPolicy(
|
|||
id: string,
|
||||
options?: { standalone: boolean }
|
||||
): Promise<FullAgentPolicy | null> {
|
||||
let agentPolicy;
|
||||
let agentPolicy: AgentPolicy | null | undefined;
|
||||
const standalone = options?.standalone ?? false;
|
||||
|
||||
try {
|
||||
|
@ -187,7 +193,9 @@ export async function getFullAgentPolicy(
|
|||
if (!standalone) {
|
||||
const fleetServerHost = await getFleetServerHostsForAgentPolicy(soClient, agentPolicy).catch(
|
||||
(err) => {
|
||||
appContextService.getLogger()?.error(err);
|
||||
appContextService
|
||||
.getLogger()
|
||||
?.warn(`Unable to get fleet server hosts for policy ${agentPolicy?.id}: ${err.message}`);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue