diff --git a/api/datadoghq/common/const.go b/api/datadoghq/common/const.go index 8b98fe244..67a599fcb 100644 --- a/api/datadoghq/common/const.go +++ b/api/datadoghq/common/const.go @@ -82,6 +82,10 @@ const ( RpmDirVolumePath = "/var/lib/rpm" RpmDirMountPath = "/host/var/lib/rpm" + SysimageRpmDirVolumeName = "host-sysimage-rpm-dir" + SysimageRpmDirVolumePath = "/usr/lib/sysimage/rpm" + SysimageRpmDirMountPath = "/host/usr/lib/sysimage/rpm" + RedhatReleaseVolumeName = "etc-redhat-release" RedhatReleaseVolumePath = "/etc/redhat-release" RedhatReleaseMountPath = "/host/etc/redhat-release" diff --git a/internal/controller/datadogagent/feature/sbom/feature.go b/internal/controller/datadogagent/feature/sbom/feature.go index 2bd52927a..2046a7a85 100644 --- a/internal/controller/datadogagent/feature/sbom/feature.go +++ b/internal/controller/datadogagent/feature/sbom/feature.go @@ -222,6 +222,10 @@ func (f *sbomFeature) ManageNodeAgent(managers feature.PodTemplateManagers, prov volMountMgr.AddVolumeMountToContainer(&hostRpmVolMount, apicommon.CoreAgentContainerName) volMgr.AddVolume(&hostRpmVol) + hostSysimageRpmVol, hostSysimageRpmVolMount := volume.GetVolumes(apicommon.SysimageRpmDirVolumeName, apicommon.SysimageRpmDirVolumePath, apicommon.SysimageRpmDirMountPath, true) + volMountMgr.AddVolumeMountToContainer(&hostSysimageRpmVolMount, apicommonv1.CoreAgentContainerName) + volMgr.AddVolume(&hostSysimageRpmVol) + hostRedhatReleaseVol, hostRedhatReleaseVolMount := volume.GetVolumes(apicommon.RedhatReleaseVolumeName, apicommon.RedhatReleaseVolumePath, apicommon.RedhatReleaseMountPath, true) volMountMgr.AddVolumeMountToContainer(&hostRedhatReleaseVolMount, apicommon.CoreAgentContainerName) volMgr.AddVolume(&hostRedhatReleaseVol) diff --git a/internal/controller/datadogagent/feature/sbom/feature_test.go b/internal/controller/datadogagent/feature/sbom/feature_test.go index 0624e87e8..e92fc2a5a 100644 --- a/internal/controller/datadogagent/feature/sbom/feature_test.go +++ b/internal/controller/datadogagent/feature/sbom/feature_test.go @@ -175,6 +175,11 @@ func Test_sbomFeature_Configure(t *testing.T) { MountPath: apicommon.RpmDirMountPath, ReadOnly: true, }, + { + Name: apicommon.SysimageRpmDirVolumeName, + MountPath: apicommon.SysimageRpmDirMountPath, + ReadOnly: true, + }, { Name: apicommon.RedhatReleaseVolumeName, MountPath: apicommon.RedhatReleaseMountPath,