Skip to content

symbolic link is unnecessary, since they cannot be created in a read-only rootfs #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions cmd/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
#!/bin/sh
Expand Down
2 changes: 1 addition & 1 deletion cmd/exec/exec_kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down