mirror of
https://github.com/moby/moby.git
synced 2026-07-08 07:37:55 +00:00
The IPCMode type was added in497fc8876e, and from that patch, the intent was to allow `host` (without `:`), `""` (empty, default) or `container:<container ID>`, but the `Valid()` function seems to be too relaxed and accepting both `:`, as well as `host:<anything>`. No unit-tests were added in that patch, and integration-tests only tested for valid values. Later on, `PidMode`, and `UTSMode` were added in23feaaa240andf2e5207fc9, both of which were implemented as a straight copy of the `IPCMode` implementation, copying the same bug. Finally, commitd4aec5f0a6implemented unit-tests for these types, but testing for the wrong behavior of the implementation. This patch updates the validation to correctly invalidate `host[:<anything>]` and empty (`:`) types. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>