Skip to content

Commit

Permalink
remove kernel headers mount if btf found with initdeploy flag = true
Browse files Browse the repository at this point in the history
Signed-off-by: Aryan-sharma11 <[email protected]>
  • Loading branch information
Aryan-sharma11 committed Jun 20, 2024
1 parent 322dd5a commit e5cbb70
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/KubeArmorOperator/internal/controller/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand Down

0 comments on commit e5cbb70

Please sign in to comment.