diff --git a/pkg/KubeArmorOperator/internal/controller/resources.go b/pkg/KubeArmorOperator/internal/controller/resources.go index 94029195d1..ecc4fd799c 100644 --- a/pkg/KubeArmorOperator/internal/controller/resources.go +++ b/pkg/KubeArmorOperator/internal/controller/resources.go @@ -40,11 +40,13 @@ func generateDaemonset(name, enforcer, runtime, socket, btfPresent, apparmorfs, commonVols := common.CommonVolumes commonVolMnts := common.CommonVolumesMount - if btfPresent == "no" || initDeploy { + if initDeploy || btfPresent == "no" { + if btfPresent == "no" { + commonVols = append(commonVols, common.KernelHeaderVolumes...) + commonVolMnts = append(commonVolMnts, common.KernelHeaderVolumesMount...) + } commonVols = append(commonVols, common.BPFVolumes...) commonVolMnts = append(commonVolMnts, common.BPFVolumesMount...) - commonVols = append(commonVols, common.KernelHeaderVolumes...) - commonVolMnts = append(commonVolMnts, common.KernelHeaderVolumesMount...) } vols = append(vols, commonVols...) volMnts = append(volMnts, commonVolMnts...)