From fb7f0203335ce9b624c741e4518bd5337bce7b1a Mon Sep 17 00:00:00 2001 From: entlein Date: Fri, 13 Feb 2026 19:24:31 +0100 Subject: [PATCH] bug fix relative paths, attempt1 Signed-off-by: entlein --- pkg/containerwatcher/v2/tracers/open.go | 3 +-- pkg/utils/datasource_event.go | 6 +----- pkg/utils/struct_event.go | 6 +++--- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/pkg/containerwatcher/v2/tracers/open.go b/pkg/containerwatcher/v2/tracers/open.go index 7e82793ed..a76f9eecb 100644 --- a/pkg/containerwatcher/v2/tracers/open.go +++ b/pkg/containerwatcher/v2/tracers/open.go @@ -2,7 +2,6 @@ package tracers import ( "context" - "strconv" "github.com/inspektor-gadget/inspektor-gadget/pkg/datasource" gadgetcontext "github.com/inspektor-gadget/inspektor-gadget/pkg/gadget-context" @@ -70,7 +69,7 @@ func (ot *OpenTracer) Start(ctx context.Context) error { ) go func() { params := map[string]string{ - "operator.oci.ebpf.paths": strconv.FormatBool(ot.cfg.EnableFullPathTracing), + "operator.oci.ebpf.paths": "true", "operator.LocalManager.host": "true", // don't error if container-collection is nil when using local manager } err := ot.runtime.RunGadget(ot.gadgetCtx, nil, params) diff --git a/pkg/utils/datasource_event.go b/pkg/utils/datasource_event.go index 0c31c8b20..d9bc2c587 100644 --- a/pkg/utils/datasource_event.go +++ b/pkg/utils/datasource_event.go @@ -553,13 +553,9 @@ func (e *DatasourceEvent) GetOtherIp() string { } func (e *DatasourceEvent) GetPath() string { - if e.FullPathTracing { - return e.GetFullPath() - } switch e.EventType { case OpenEventType: - path, _ := e.getFieldAccessor("fname").String(e.Data) - return path + return e.GetFullPath() default: logger.L().Warning("GetPath not implemented for event type", helpers.String("eventType", string(e.EventType))) return "" diff --git a/pkg/utils/struct_event.go b/pkg/utils/struct_event.go index 674af7037..8fe4c79c1 100644 --- a/pkg/utils/struct_event.go +++ b/pkg/utils/struct_event.go @@ -403,11 +403,11 @@ func (e *StructEvent) GetOtherIp() string { } func (e *StructEvent) GetPath() string { - if e.FullPathTracing { - return e.GetFullPath() - } switch e.EventType { case OpenEventType: + if e.FullPath != "" { + return e.FullPath + } return e.Path default: logger.L().Warning("GetPath not implemented for event type", helpers.String("eventType", string(e.EventType)))