Skip to content

Commit

Permalink
move runtime constant edition
Browse files Browse the repository at this point in the history
  • Loading branch information
safchain committed Feb 11, 2025
1 parent c80ddc5 commit 403010e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pkg/security/probe/probe_ebpf.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,13 +438,6 @@ func (p *EBPFProbe) Init() error {
}
}

if p.isRuntimeDiscarded {
p.managerOptions.ConstantEditors = append(p.managerOptions.ConstantEditors, manager.ConstantEditor{
Name: "runtime_discarded",
Value: uint64(1),
})
}

p.inodeDiscarders = newInodeDiscarders(p.Erpc, p.Resolvers.DentryResolver)

if err := p.Resolvers.Start(p.ctx); err != nil {
Expand Down Expand Up @@ -2133,6 +2126,14 @@ func (p *EBPFProbe) initManagerOptionsConstants() {
},
)
}

// mostly used for testing purpose
if p.isRuntimeDiscarded {
p.managerOptions.ConstantEditors = append(p.managerOptions.ConstantEditors, manager.ConstantEditor{
Name: "runtime_discarded",
Value: uint64(1),
})
}
}

// initManagerOptionsMaps initializes the eBPF manager map spec editors and map reader startup
Expand Down

0 comments on commit 403010e

Please sign in to comment.