diff --git a/cmd/tetragon/main.go b/cmd/tetragon/main.go index af2df0d6504..50de8cd8e85 100644 --- a/cmd/tetragon/main.go +++ b/cmd/tetragon/main.go @@ -259,7 +259,6 @@ func tetragonExecute() error { // Get observer bpf maps and programs directory observerDir := getObserverDir() option.Config.BpfDir = observerDir - option.Config.MapDir = observerDir // Check if option to remove old BPF and maps is enabled. if option.Config.ReleasePinned { @@ -353,7 +352,7 @@ func tetragonExecute() error { } // Probe runtime configuration and do not fail on errors - obs.UpdateRuntimeConf(option.Config.MapDir) + obs.UpdateRuntimeConf(option.Config.BpfDir) var k8sWatcher watcher.K8sResourceWatcher if option.Config.EnableK8s { diff --git a/pkg/bench/bench.go b/pkg/bench/bench.go index ad4f4f0a114..fbc56a57708 100644 --- a/pkg/bench/bench.go +++ b/pkg/bench/bench.go @@ -86,7 +86,6 @@ func runTetragon(ctx context.Context, configFile string, args *Arguments, summar option.Config.RBSize = args.RBSize option.Config.BpfDir = bpf.MapPrefixPath() - option.Config.MapDir = bpf.MapPrefixPath() obs := observer.NewObserver(configFile) if err := obs.InitSensorManager(nil); err != nil { diff --git a/pkg/metrics/eventmetrics/collector.go b/pkg/metrics/eventmetrics/collector.go index 4f3dcd30911..de63fae34ff 100644 --- a/pkg/metrics/eventmetrics/collector.go +++ b/pkg/metrics/eventmetrics/collector.go @@ -25,7 +25,7 @@ func (c *bpfCollector) Describe(ch chan<- *prometheus.Desc) { } func (c *bpfCollector) Collect(ch chan<- prometheus.Metric) { - mapHandle, err := ebpf.LoadPinnedMap(filepath.Join(option.Config.MapDir, "tg_stats_map"), nil) + mapHandle, err := ebpf.LoadPinnedMap(filepath.Join(option.Config.BpfDir, "tg_stats_map"), nil) if err != nil { return } diff --git a/pkg/observer/observer_stats.go b/pkg/observer/observer_stats.go index 184a4c35574..59821546ee0 100644 --- a/pkg/observer/observer_stats.go +++ b/pkg/observer/observer_stats.go @@ -45,7 +45,7 @@ func (c *bpfCollector) Collect(ch chan<- prometheus.Metric) { continue } processedMaps[name] = true - pin := filepath.Join(option.Config.MapDir, name) + pin := filepath.Join(option.Config.BpfDir, name) // Skip map names that end up with _stats. // This will result in _stats_stats suffixes that we don't care about if strings.HasSuffix(pin, statsSuffix) { diff --git a/pkg/observer/observertesthelper/observer_test_helper.go b/pkg/observer/observertesthelper/observer_test_helper.go index 91dba70818e..b6907bb3cb5 100644 --- a/pkg/observer/observertesthelper/observer_test_helper.go +++ b/pkg/observer/observertesthelper/observer_test_helper.go @@ -207,7 +207,6 @@ func newDefaultTestOptions(opts ...TestOption) *TestOptions { func newDefaultObserver(oo *testObserverOptions) *observer.Observer { option.Config.BpfDir = bpf.MapPrefixPath() - option.Config.MapDir = bpf.MapPrefixPath() return observer.NewObserver(oo.config) } @@ -312,7 +311,6 @@ func GetDefaultSensorsWithFile(tb testing.TB, file, lib string, opts ...TestOpti opts = append(opts, WithLib(lib)) option.Config.BpfDir = bpf.MapPrefixPath() - option.Config.MapDir = bpf.MapPrefixPath() testutils.CaptureLog(tb, logger.GetLogger().(*logrus.Logger)) diff --git a/pkg/option/config.go b/pkg/option/config.go index 17b4bc2221f..bd0dec4894f 100644 --- a/pkg/option/config.go +++ b/pkg/option/config.go @@ -35,7 +35,6 @@ type config struct { GopsAddr string - MapDir string BpfDir string LogOpts map[string]string