From b7a2e89899f47219e2d6c55b4b70305aa8161e42 Mon Sep 17 00:00:00 2001 From: Amit Schendel Date: Tue, 4 Jun 2024 08:12:31 +0000 Subject: [PATCH] Fixing hardlink rule Signed-off-by: Amit Schendel --- pkg/containerwatcher/v1/container_watcher_private.go | 11 +++++++++++ pkg/containerwatcher/v1/hardlink.go | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/containerwatcher/v1/container_watcher_private.go b/pkg/containerwatcher/v1/container_watcher_private.go index efd65ed9..0521222b 100644 --- a/pkg/containerwatcher/v1/container_watcher_private.go +++ b/pkg/containerwatcher/v1/container_watcher_private.go @@ -259,6 +259,11 @@ func (ch *IGContainerWatcher) startTracers() error { logger.L().Error("error starting symlink tracing", helpers.Error(err)) return err } + + if err := ch.startHardlinkTracing(); err != nil { + logger.L().Error("error starting hardlink tracing", helpers.Error(err)) + return err + } } return nil @@ -318,6 +323,12 @@ func (ch *IGContainerWatcher) stopTracers() error { logger.L().Error("error stopping symlink tracing", helpers.Error(err)) errs = errors.Join(errs, err) } + + // Stop hardlink tracer + if err := ch.stopHardlinkTracing(); err != nil { + logger.L().Error("error stopping hardlink tracing", helpers.Error(err)) + errs = errors.Join(errs, err) + } } return errs diff --git a/pkg/containerwatcher/v1/hardlink.go b/pkg/containerwatcher/v1/hardlink.go index 58673905..d637122d 100644 --- a/pkg/containerwatcher/v1/hardlink.go +++ b/pkg/containerwatcher/v1/hardlink.go @@ -33,8 +33,8 @@ func (ch *IGContainerWatcher) startHardlinkTracing() error { } go func() { - for event := range ch.symlinkWorkerChan { - ch.symlinkWorkerPool.Invoke(*event) + for event := range ch.hardlinkWorkerChan { + ch.hardlinkWorkerPool.Invoke(*event) } }()