fix: node shell on Bottlerocket hosts#27
Merged
Conversation
Bottlerocket's host /bin/sh is brush, a sandboxed shell whose allow-list refuses almost every program (even ls), so the --mount host-shell path is unusable there. Branch on the node's OSImage: Bottlerocket nodes skip --mount and run the helper image's own busybox shell with the host pid/net/ipc/uts namespaces, starting in /proc/1/root so the live host filesystem and every host process are still reachable. Normal hosts keep the --mount path with the bash/sh probe. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Node shell errored on Bottlerocket OS nodes (exit 127, cryptic Rust-style errors). Root cause: Bottlerocket's host
/bin/shisbrush, a sandboxed shell whose allow-list refuses almost every program — evenls— so the--mounthost-shell path lands in an unusable jail.Fix
Branch on the node's
OSImage:--mountand run the helper image's own busybox shell with the host'spid/net/ipc/utsnamespaces, starting in/proc/1/root. The live host filesystem and every host process are still reachable; only the shell binary and/come from the helper image.--mountinto the host, prefer hostbash, fall back tosh.Testing
Verified live in
wails devagainst a Bottlerocket EKS cluster (lands inhost:/proc/1/root#,ls/pswork, host processes visible) with no regression on Amazon Linux 2023 EKS or local OrbStack.go test/go vetpass; addedTestNodeShellCommandcovering both branches.🤖 Generated with Claude Code