1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/cli/command/container
Yong Tang 3e9dd55695 Use map[string]bool for preProcessor to ignore unknwon field
This fix is an attempt to address the issue raised in 28339. In
`docker ps`, the formatter needs to expose all fields of `types.Container`
to `preProcessor` so that template could be executed.

This direct exposing is unreliable and could cause issues as user may incorrectly
assume all fields in `types.Container` will be available for templating.

However, the purpose of `preProcessor` is to only find out if `.Size`
is defined (so that opts.size could be set accordingly).

This fix defines `preProcessor` as `map[string]bool` with a func `Size()`.
In this way, any unknown fields will be ignored.

This fix adds several test cases to the existing `TestBuildContainerListOptions`.

This fix fixes 28339.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 312cc7eebd)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:42:21 -08:00
..
attach.go Move api/client -> cli/command 2016-09-08 15:46:29 -04:00
cmd.go refactor help func in CLI 2016-11-18 13:30:44 -08:00
commit.go Move api/client -> cli/command 2016-09-08 15:46:29 -04:00
cp.go Move api/client -> cli/command 2016-09-08 15:46:29 -04:00
create.go Generate container create response from swagger spec. 2016-10-31 11:16:02 -04:00
diff.go Move api/client -> cli/command 2016-09-08 15:46:29 -04:00
exec.go Remove redundant parameter and fix typos 2016-11-10 11:05:31 +08:00
exec_test.go Remove redundant parameter and fix typos 2016-11-10 11:05:31 +08:00
export.go Move api/client -> cli/command 2016-09-08 15:46:29 -04:00
hijack.go Move image trust related cli methods into the image package. 2016-09-09 10:50:16 -04:00
inspect.go Fix typs from go to Go 2016-10-18 19:40:16 +08:00
kill.go Support parallel kill 2016-09-28 12:03:19 +08:00
list.go Use map[string]bool for preProcessor to ignore unknwon field 2016-11-18 13:42:21 -08:00
logs.go Move api/client -> cli/command 2016-09-08 15:46:29 -04:00
pause.go Add parallel operation support for pause/unpause 2016-09-13 11:01:28 +08:00
port.go Move api/client -> cli/command 2016-09-08 15:46:29 -04:00
prune.go always add but hide experimental cmds and flags 2016-11-08 04:55:27 -08:00
ps_test.go Use map[string]bool for preProcessor to ignore unknwon field 2016-11-18 13:42:21 -08:00
rename.go Move api/client -> cli/command 2016-09-08 15:46:29 -04:00
restart.go Update docker stop and docker restart to allow not specifying timeout and use the one specified at container creation time. 2016-10-17 12:53:35 -07:00
rm.go Support parallel rm 2016-09-28 12:07:18 +08:00
run.go Refactor to new events api 2016-09-22 14:42:06 -04:00
start.go context.Context should be the first parameter of a function 2016-11-08 14:51:17 +08:00
stats.go Add StatsFormat to the config.json file 2016-10-28 11:48:25 -07:00
stats_helpers.go Add support for Names and ID in stats format 2016-11-03 07:20:46 +01:00
stats_unit_test.go Update function name for TestCalculBlockIO 2016-11-09 17:43:10 +08:00
stop.go Update docker stop and docker restart to allow not specifying timeout and use the one specified at container creation time. 2016-10-17 12:53:35 -07:00
top.go Move api/client -> cli/command 2016-09-08 15:46:29 -04:00
tty.go Windows: OCI process struct convergence 2016-09-19 10:34:31 -07:00
unpause.go Add parallel operation support for pause/unpause 2016-09-13 11:01:28 +08:00
update.go Fixes #27798 : Update help for --blkio-weight parameter 2016-11-03 06:42:15 +00:00
utils.go Merge pull request #26778 from WeiZhang555/parallel-operations 2016-10-10 18:31:10 +02:00
wait.go Move api/client -> cli/command 2016-09-08 15:46:29 -04:00