File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
x-pack/plugins/security_solution/common/endpoint Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -316,15 +316,26 @@ const fleetEnrollAgentForHost = async (
316316 return ;
317317 }
318318
319- const kibanaVersion = await kbnClient . fetchKibanaVersion ( ) . number ;
319+ const fetchKibanaVersion = async ( ) => {
320+ const version = ( ( await kbnClient . request ( {
321+ path : '/api/status' ,
322+ method : 'GET' ,
323+ } ) ) as AxiosResponse ) . data . version . number ;
324+ if ( ! version ) {
325+ // eslint-disable-next-line no-console
326+ console . log ( 'failed to retrieve kibana version' ) ;
327+ }
328+ return version ;
329+ } ;
330+
320331 // Enroll an agent for the Host
321332 const body : PostAgentEnrollRequest [ 'body' ] = {
322333 type : 'PERMANENT' ,
323334 metadata : {
324335 local : {
325336 elastic : {
326337 agent : {
327- version : '8.0.0' ,
338+ version : await fetchKibanaVersion ( ) ,
328339 } ,
329340 } ,
330341 host : {
You can’t perform that action at this time.
0 commit comments