Skip to content

Commit

Permalink
tetragon: load tracing policy provided by command line via sensor man…
Browse files Browse the repository at this point in the history
…ager

Signed-off-by: Liang Deng <[email protected]>
  • Loading branch information
YTGhost authored and kkourt committed Apr 4, 2023
1 parent e6c52e7 commit 7a13def
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions cmd/tetragon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"github.com/cilium/tetragon/pkg/process"
"github.com/cilium/tetragon/pkg/ratelimit"
"github.com/cilium/tetragon/pkg/rthooks"
"github.com/cilium/tetragon/pkg/sensors"
"github.com/cilium/tetragon/pkg/sensors/base"
"github.com/cilium/tetragon/pkg/sensors/program"
"github.com/cilium/tetragon/pkg/server"
Expand Down Expand Up @@ -315,22 +314,15 @@ func tetragonExecute() error {

// load sensor from configuration file
if len(option.Config.ConfigFile) > 0 {
var sens *sensors.Sensor
tp, err := config.PolicyFromYamlFilename(option.Config.ConfigFile)
if err != nil {
return err
}

sens, err = sensors.GetMergedSensorFromParserPolicy(tp)
err = observer.SensorManager.AddTracingPolicy(ctx, tp)
if err != nil {
return err
}

// NB: simlarly to the base sensor we are loading this
// statically (instead of the sensor manager).
if err := sens.Load(ctx, observerDir, observerDir, option.Config.CiliumDir); err != nil {
return err
}
}

// k8s should have metrics, so periodically log only in a non k8s
Expand Down

0 comments on commit 7a13def

Please sign in to comment.