docker: pin validate fallback runs compose with no -f when the chooser answers null #51

Open
opened 2026-08-21 23:21:08 +02:00 by julian · 0 comments
Owner

Follow-up from the approving review on #48 (inline nit, pre-existing).

Reachable when answeringContainer answers null (a project of nothing but one-offs) or the answering container has no config_files (e.g. a hand-run container carrying only the project label): in the pin action's validate fallback (packages/modules/docker/backend/actions.ts, around line 513) files is [], so the fallback runs docker host-side compose config -q with no -f at all. Compose then resolves whatever sits in the host CWD, or dies with no configuration file provided: not found. The edits are rolled back either way, but the operator gets an error about the wrong thing.

The container-pin action's fallback already does the better thing — edits.flatMap((e) => ["-f", e.file]), i.e. the files this run actually patched. patches is in scope at the stack-pin site and holds exactly that.

Source: #48 (comment)

Follow-up from the approving review on #48 (inline nit, pre-existing). Reachable when `answeringContainer` answers null (a project of nothing but one-offs) or the answering container has no `config_files` (e.g. a hand-run container carrying only the project label): in the pin action's validate fallback (`packages/modules/docker/backend/actions.ts`, around line 513) `files` is `[]`, so the fallback runs `docker host-side compose config -q` with no `-f` at all. Compose then resolves whatever sits in the host CWD, or dies with `no configuration file provided: not found`. The edits are rolled back either way, but the operator gets an error about the wrong thing. The container-pin action's fallback already does the better thing — `edits.flatMap((e) => ["-f", e.file])`, i.e. the files this run actually patched. `patches` is in scope at the stack-pin site and holds exactly that. Source: https://git.imhof.cloud/OpsDeck/core/pulls/48#issuecomment-1029
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
OpsDeck/core#51
No description provided.