override infoMap only if it's not nil

This commit is contained in:
David Wertenteil
2022-08-24 17:10:18 +03:00
parent 2bc63c2ab6
commit 3bec2ef0b7
+3 -1
View File
@@ -104,7 +104,9 @@ func (k8sHandler *K8sResourceHandler) GetResources(sessionObj *cautils.OPASessio
// using hostSensor mock
cautils.SetInfoMapForResources("failed to init host scanner", hostResources, sessionObj.InfoMap)
} else {
sessionObj.InfoMap = infoMap
if len(infoMap) > 0 {
sessionObj.InfoMap = infoMap
}
}
} else {
cautils.SetInfoMapForResources("enable-host-scan flag not used. For more information: https://hub.armosec.io/docs/host-sensor", hostResources, sessionObj.InfoMap)