Skip to content

Commit 93d74e6

Browse files
committed
fix healthcheck path issues
Signed-off-by: Arjun Raja Yogidas <[email protected]>
1 parent f144078 commit 93d74e6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/healthcheck/healthcheck_manager_linux.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,14 @@ func CreateTimer(ctx context.Context, container containerd.Container, cfg *confi
5656
// Always use health-interval for timer frequency
5757
cmdOpts = append(cmdOpts, "--unit", containerID, "--on-unit-inactive="+hc.Interval.String(), "--timer-property=AccuracySec=1s")
5858

59-
cmdOpts = append(cmdOpts, "nerdctl", "container", "healthcheck", containerID)
59+
// Get the full path to the current nerdctl binary
60+
nerdctlPath, err := os.Executable()
61+
if err != nil {
62+
log.G(ctx).Warnf("Could not determine nerdctl executable path: %v, using 'nerdctl'", err)
63+
nerdctlPath = "nerdctl"
64+
}
65+
66+
cmdOpts = append(cmdOpts, nerdctlPath, "container", "healthcheck", containerID)
6067
if log.G(ctx).Logger.IsLevelEnabled(log.DebugLevel) {
6168
cmdOpts = append(cmdOpts, "--debug")
6269
}

0 commit comments

Comments
 (0)