bottlerocket-os/twoliter

Improve `docker-go` interface

オープン

#492 opened on 2022/10/28

 (0 件のコメント) (1 件のリアクション) (0 人の担当者)Rust (43 件のフォーク)auto 404
help wanted

Repository metrics

Stars
 (34 個のスター)
PR merge metrics
 (平均マージ 4d 18h) (30d で 19 merged PRs)

説明

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

コントリビューターガイド