From 7e6c1388a6eaf26176526f41258adccae409ac08 Mon Sep 17 00:00:00 2001 From: Ritik Jain <60597329+re-Tick@users.noreply.github.com> Date: Wed, 24 Apr 2024 15:05:44 +0530 Subject: [PATCH] fix: fixes dns problem to redirect them to proxy in test mode (#1850) * fix: fixes dns problem to redirect them to proxy in test mode Signed-off-by: re-Tick * fix: fixes linting issues in core.go Signed-off-by: re-Tick --------- Signed-off-by: re-Tick --- pkg/core/core.go | 1 + pkg/core/hooks/hooks.go | 2 +- pkg/core/service.go | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/core/core.go b/pkg/core/core.go index 8de41f2f8..c5f275fe7 100644 --- a/pkg/core/core.go +++ b/pkg/core/core.go @@ -130,6 +130,7 @@ func (c *Core) Hook(ctx context.Context, id uint64, opts models.HookOptions) err Pid: 0, IsDocker: isDocker, KeployIPV4: a.KeployIPv4Addr(), + Mode: opts.Mode, }) if err != nil { utils.LogError(c.logger, err, "failed to load hooks") diff --git a/pkg/core/hooks/hooks.go b/pkg/core/hooks/hooks.go index 9705bb6c1..2560d2ad2 100644 --- a/pkg/core/hooks/hooks.go +++ b/pkg/core/hooks/hooks.go @@ -445,7 +445,7 @@ func (h *Hooks) load(_ context.Context, opts core.HookCfg) error { h.logger.Info("keploy initialized and probes added to the kernel.") - switch models.GetMode() { + switch opts.Mode { case models.MODE_RECORD: err := h.SetKeployModeInKernel(1) if err != nil { diff --git a/pkg/core/service.go b/pkg/core/service.go index 0e9e33f3d..03004e952 100644 --- a/pkg/core/service.go +++ b/pkg/core/service.go @@ -24,6 +24,7 @@ type HookCfg struct { Pid uint32 IsDocker bool KeployIPV4 string + Mode models.Mode } type App interface {