Skip to content

docs: document detach as the transport option it is - #498

Merged
tas50 merged 1 commit into
mainfrom
docs/detach-is-a-transport-option
Aug 30, 2026
Merged

docs: document detach as the transport option it is#498
tas50 merged 1 commit into
mainfrom
docs/detach-is-a-transport-option

Conversation

@tas50

@tas50 tas50 commented Aug 30, 2026

Copy link
Copy Markdown
Member

detach was listed under Driver configuration → Running the container, where setting it does nothing at all.

The only place config[:detach] is read is CliHelper#build_exec_command:

def build_exec_command(state, command)
  cmd = "exec"
  cmd << " -d" if config[:detach]

and the only thing that reaches that is the transport's container. The driver constructs a container too, but only ever calls create and destroy on it, neither of which runs an exec — so a detach: true under driver: is read by nothing.

Its own description gave it away: it talks about provisioner commands and about kitchen login, both of which are the transport's business.

What changed

  • detach moved to the transport table, where setting it has the documented effect.
  • A pointer left behind in the driver section for anyone who looks where it used to be, since the sentence about the container always being started detached is still worth saying there.
  • build_tempdir corrected. It said "relative to build_context"; it is resolved against the working directory (Pathname.pwd + config[:build_tempdir]), and dockerfile_path then makes the -f argument relative to the working directory too, which is what constrains where it can be.

Documentation only — no behaviour change. I checked the rest of the option tables against default_config and the config keys lib/ actually reads while I was in here; everything else lines up, including the defaults.

Verification

$ npx markdownlint-cli2 README.md
Summary: 0 issues in 0 files

$ bundle exec rake test
360 examples, 0 failures

$ cookstyle --chefstyle          # Cookstyle 9.0.0 / RuboCop 1.90.0
44 files inspected, no offenses detected

`detach` was listed under "Running the container" in the driver's
configuration, where setting it does nothing at all. The only place
`config[:detach]` is read is `build_exec_command`, and the only thing
that reaches it is the transport's container -- the driver's container
never runs an exec. Its own description gives it away: it talks about
provisioner commands and about `kitchen login`, both of which are the
transport's business.

Moved to the transport table, where setting it has the documented
effect, with a pointer left behind for anyone who looks where it used to
be.

Also corrects `build_tempdir`, which is resolved against the working
directory rather than against `build_context`.

Signed-off-by: Tim Smith <tim@mondoo.com>
@tas50
tas50 merged commit 62c087e into main Aug 30, 2026
107 checks passed
@tas50
tas50 deleted the docs/detach-is-a-transport-option branch August 30, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants