Closed misterdjules closed 9 years ago
/cc @joshwilsdon @trentm @twhiteman
@joshwilsdon Updated the changes according to your code review, thank you :)
I notice there's still MEMORY_IN_MBS while BYTES_IN_MBS was changed to BYTES_IN_MB, should we change MEMORY_IN_MBS too?
Otherwise: LGTM
@joshwilsdon I wrote MEMORY_IN_MBS
as "This value represents megabytes of data", hence the plural form, whereas BYTES_IN_MBS
was changed to BYTES_IN_MB
since it means "How many bytes in one megabyte`. However my English is not that great, so if that's not correct I'll change it :)
Landed in c0cc2ee5c4bb77416c15f8a29bf60e37f83760d3. Thank you @joshwilsdon :+1:
Instead of getting the value
Memory
from just the root of the container object, which is where docker clients < 1.7 put it, we also check incontainer.HostConfig.Memory
, which is where docker clients >= 1.7 put it.This commit adds integration tests for this change. These tests create docker containers with a memory value different than the default memory value and mimic the behavior of docker clients pre and post 1.7.
This commit also moves
loadConfigSync
to its own module so that it can be used by tests that need to load the configuration to lookup default values (such asdefaultMemory
in this case).