bottlerocket-os / bottlerocket-os/twoliter
Improve `docker-go` interface
- Dominant language
- Rust
- Stars
- 34
- Forks
- 43
- Avg merge
- 11h 13m
- Merged PRs (30d)
- 16
Description
The only safe way to use `docker-go` is to pass a single argument to `--command`. Anything else would lead to unexpected behavior, for example `docker-go --command foo bar baz` is indistinguishable from `docker-go --command foo 'bar baz'` and `docker-go --command foo --module-path bar` will both pass `--module-path bar` to `foo`, and actually modify the script's `GO_MODULE_PATH` variable.
Is it feasible to change the script's interface without too many coordinated changes? A safer interface could interpret anything after `--` as the command to execute, and keep all following arguments in an array (`COMMAND=( "$@" )`, later: `"${COMMAND[@]}"`) to retain fidelity of the originally passed-in arguments.
_Originally posted by @markusboehme in https://github.com/bottlerocket-os/bottlerocket/pull/2532#discussion_r1007948798_
Contributor guide
Research direction
Start by locating the docker-go script and its callers, then review the interface discussion linked in the issue. Trace how command-line arguments are currently parsed and forwarded; done means arguments after -- remain distinct and are passed to the command without altering option-like values, with any affected callers updated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, shell
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100