mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
12b6083c8f
Closes #14621 This one grew to be much more than I expected so here's the story... :-) - when a bad port string (e.g. xxx80) is passed into container.create() via the API it wasn't being checked until we tried to start the container. - While starting the container we trid to parse 'xxx80' in nat.Int() and would panic on the strconv.ParseUint(). We should (almost) never panic. - In trying to remove the panic I decided to make it so that we, instead, checked the string during the NewPort() constructor. This means that I had to change all casts from 'string' to 'Port' to use NewPort() instead. Which is a good thing anyway, people shouldn't assume they know the internal format of types like that, in general. - This meant I had to go and add error checks on all calls to NewPort(). To avoid changing the testcases too much I create newPortNoError() **JUST** for the testcase uses where we know the port string is ok. - After all of that I then went back and added a check during container.create() to check the port string so we'll report the error as soon as we get the data. - If, somehow, the bad string does get into the metadata we will generate an error during container.start() but I can't test for that because the container.create() catches it now. But I did add a testcase for that. Signed-off-by: Doug Davis <dug@us.ibm.com> |
||
---|---|---|
.. | ||
events | ||
execdriver | ||
graphdriver | ||
logger | ||
network | ||
attach.go | ||
changes.go | ||
commit.go | ||
config.go | ||
config_experimental.go | ||
config_linux.go | ||
config_stub.go | ||
config_windows.go | ||
container.go | ||
container_unit_test.go | ||
container_unix.go | ||
container_windows.go | ||
copy.go | ||
create.go | ||
daemon.go | ||
daemon_aufs.go | ||
daemon_btrfs.go | ||
daemon_devicemapper.go | ||
daemon_no_aufs.go | ||
daemon_overlay.go | ||
daemon_test.go | ||
daemon_unit_test.go | ||
daemon_unix.go | ||
daemon_windows.go | ||
daemon_zfs.go | ||
debugtrap_unix.go | ||
debugtrap_unsupported.go | ||
debugtrap_windows.go | ||
delete.go | ||
exec.go | ||
exec_linux.go | ||
exec_windows.go | ||
export.go | ||
history.go | ||
image_delete.go | ||
info.go | ||
inspect.go | ||
kill.go | ||
list.go | ||
logdrivers_linux.go | ||
logdrivers_windows.go | ||
logs.go | ||
monitor.go | ||
pause.go | ||
README.md | ||
rename.go | ||
resize.go | ||
restart.go | ||
start.go | ||
state.go | ||
state_test.go | ||
stats.go | ||
stats_collector_unix.go | ||
stats_collector_windows.go | ||
stats_linux.go | ||
stats_windows.go | ||
stop.go | ||
top.go | ||
unpause.go | ||
utils_nounix.go | ||
utils_test.go | ||
utils_unix.go | ||
volumes.go | ||
volumes_experimental.go | ||
volumes_experimental_unit_test.go | ||
volumes_linux.go | ||
volumes_stubs.go | ||
volumes_stubs_unit_test.go | ||
volumes_unit_test.go | ||
volumes_windows.go | ||
wait.go |
This directory contains code pertaining to running containers and storing images
Code pertaining to running containers:
- execdriver
- networkdriver
Code pertaining to storing images:
- graphdriver