Skip to content

Comments

fix: filter docker compose hook rewrites to supported subcommands#245

Open
mercierj wants to merge 1 commit intortk-ai:masterfrom
mercierj:fix/docker-compose-hook-filter
Open

fix: filter docker compose hook rewrites to supported subcommands#245
mercierj wants to merge 1 commit intortk-ai:masterfrom
mercierj:fix/docker-compose-hook-filter

Conversation

@mercierj
Copy link

Fixes #244

The hook was rewriting all docker compose commands to rtk docker compose, but rtk only supports ps, logs, and build as compose subcommands. Everything else (up, down, exec, restart...) and compose-level flags (-f, --project-name, --env-file) caused failures like:

error: unexpected argument '-f' found

This PR applies the same filtering approach already used by the regular docker branch: only rewrite when the subcommand is known to be supported.

Changes

  • rtk-rewrite.sh: Extract compose subcommand and match against ps|logs|build before rewriting
  • test-rtk-rewrite.sh: Updated compose tests to expect passthrough for unsupported subcommands, added coverage for ps, build, -f flag, and env var prefix with supported/unsupported subcommands

Test results

All docker compose tests pass. The 9 pre-existing failures (find, tree, wget, audit) are unrelated.

The hook was rewriting all `docker compose` commands to `rtk docker
compose`, but rtk only supports ps, logs, and build. Unsupported
subcommands (up, down, exec, restart...) and compose-level flags
(-f, --project-name) caused hard failures.

Now matches the approach used by the regular docker branch: only
rewrite when the subcommand is known to be supported.

Fixes rtk-ai#244

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Hook rewrites unsupported docker compose commands, causing failures

1 participant