From ffd6da34473f71d03cd879698f7788a7ef49bb1e Mon Sep 17 00:00:00 2001 From: Druggo Yang Date: Thu, 20 Feb 2025 20:26:14 +0800 Subject: [PATCH 1/2] symbolic link is unnecessary, since they cannot be created in a read-only file system. --- cmd/exec/exec.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/exec/exec.go b/cmd/exec/exec.go index 754df512..d6f7783c 100644 --- a/cmd/exec/exec.go +++ b/cmd/exec/exec.go @@ -308,9 +308,7 @@ if [ ${CURRENT_NIX_INODE} -ne ${TARGET_NIX_INODE} ]; then fi {{ end }} -ln -s /proc/${CURRENT_PID}/root/ /proc/{{ .TARGET_PID }}/root/.cdebug-{{ .ID }} - -export CDEBUG_ROOTFS=/.cdebug-{{ .ID }} +export CDEBUG_ROOTFS=/proc/${CURRENT_PID}/root/ cat > /.cdebug-entrypoint.sh < Date: Fri, 21 Feb 2025 16:38:21 +0800 Subject: [PATCH 2/2] A read-only file system is no longer a case --- cmd/exec/exec_kubernetes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/exec/exec_kubernetes.go b/cmd/exec/exec_kubernetes.go index 8103dd03..948726f1 100644 --- a/cmd/exec/exec_kubernetes.go +++ b/cmd/exec/exec_kubernetes.go @@ -93,7 +93,7 @@ func runDebuggerKubernetes(ctx context.Context, cli cliutil.CLI, opts *options) cli.PrintAux("Starting debugger container...\n") - useChroot := isRootUser(opts.user) && !isReadOnlyRootFS(pod, targetName) && !runsAsNonRoot(pod, targetName) + useChroot := isRootUser(opts.user) && !runsAsNonRoot(pod, targetName) if err := runPodDebugger( ctx, cli,