From 9c658e7fce07c8af43d7f2bd159fa6de642b11ed Mon Sep 17 00:00:00 2001 From: rashmy Date: Tue, 22 Jan 2019 17:45:14 -0800 Subject: [PATCH] changes for container node inventory fixed type --- installer/conf/kube.conf | 4 ++-- source/code/plugin/in_kube_nodes.rb | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/installer/conf/kube.conf b/installer/conf/kube.conf index 164865022..d0ef0517d 100644 --- a/installer/conf/kube.conf +++ b/installer/conf/kube.conf @@ -119,8 +119,8 @@ max_retry_wait 9m - - type out_oms_api + + type out_oms log_level debug buffer_chunk_limit 20m buffer_type file diff --git a/source/code/plugin/in_kube_nodes.rb b/source/code/plugin/in_kube_nodes.rb index a6908fc99..2e48e3f1f 100644 --- a/source/code/plugin/in_kube_nodes.rb +++ b/source/code/plugin/in_kube_nodes.rb @@ -6,7 +6,7 @@ module Fluent class Kube_nodeInventory_Input < Input Plugin.register_input('kubenodeinventory', self) - @@ContainerNodeInventoryTag = 'oms.api.ContainerNodeInventory' + @@ContainerNodeInventoryTag = 'oms.containerinsights.ContainerNodeInventory' def initialize super @@ -109,7 +109,12 @@ def enumerate dockerVersion.slice! "docker://" containerNodeInventoryRecord['DockerVersion'] = dockerVersion # ContainerNodeInventory data for docker version and operating system. - containerNodeInventoryEventStream.add(emitTime, containerNodeInventoryRecord) if containerNodeInventoryRecord + containerNodeInventoryWrapper = { + "DataType"=>"CONTAINER_NODE_INVENTORY_BLOB", + "IPName"=>"ContainerInsights", + "DataItems"=>[containerNodeInventoryRecord.each{|k,v| containerNodeInventoryRecord[k]=v}] + } + containerNodeInventoryEventStream.add(emitTime, containerNodeInventoryWrapper) if containerNodeInventoryWrapper wrapper = { "DataType"=>"KUBE_NODE_INVENTORY_BLOB",