bottlerocket-os/twoliter

Improve `docker-go` interface

開放

#492 建立於 2022年10月28日

 (0 則留言) (1 個反應) (0 位負責人)Rust (43 個分叉)auto 404
help wanted

倉庫指標

星標
 (34 顆星)
PR 合併指標
 (平均合併 4天 18小時) (30 天內合併 19 個 PR)

描述

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

貢獻者指南