Repository navigation
container mode: a file write honours the requested mode - #30
Merged
Merged
Conversation
FS's write case in internal/agent/tools.go always chmod'd the temp file to 0644 before renaming it into place, ignoring whatever mode the caller sent, so every file landed 0644 in the sprite regardless of runtime. A script written with an executable mode needed a separate exec chmod before it could run. fsWrite now takes an optional --mode <octal> arg (0644 when absent, unchanged from before); internal/server/real.go threads the fs/write request's ?mode= query param through to it, applied to both the Docker and Kubernetes runtimes since both exec the same in-sprite agent binary. The Sprites API and wisp already honour this mode. Closes #29.
This was referenced Sep 25, 2026
lex00
added a commit
to INTENTIUS/fountain-ops
that referenced
this pull request
Sep 26, 2026
…ted mode (#125) Bumps `spritzerImage` to `ghcr.io/intentius/spritzer:0.6.2`, which fixes INTENTIUS/spritzer#29: a file write in container mode now honours the `mode` the caller sends instead of always landing 0644. INTENTIUS/spritzer#30.
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.
Summary
internal/agent/tools.go'sFSwrite case alwayschmod'd the temp file to0644before renaming it into place, so every file written in container mode landed0644regardless of the mode the caller asked for, on both the Docker and Kubernetes runtimes (both exec the same in-sprite agent binary). A script needed a separateexec chmodbefore it could run. The Sprites API and wisp already honour the requested mode.fsWritenow takes an optional--mode <octal>arg, defaulting to0644when absent (unchanged from before).internal/server/real.go'srealFSWritethreads thefs/writerequest's?mode=query param through to it (validating it parses as octal before the exec).README.md,docs/container-mode.md) andCHANGELOG.mdupdated.Test plan
go test ./internal/server/... ./internal/agent/...— newTestFSWriteArgs(query → CLI args, including a badmode) andTestFSWriteMode(write with--mode 0755lands0755; no--modestill lands0644; a malformed--modeisExitUsageand writes nothing)just e2e-docker(container mode, Docker runtime) — extendedTestContainerModeAcceptancewith the issue's acceptance case: a file written withmode=0755is executed directly in the sprite (would fail with permission denied before this fix, since it landed non-executable)golangci-lint run ./...,gofmt -l .,go vet ./...Closes #29.