Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCKER-458: Can't specify memory for containers with 1.7 client #43

Conversation

misterdjules
Copy link
Contributor

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 in
container.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 as defaultMemory in this case).

@misterdjules
Copy link
Contributor Author

/cc @joshwilsdon @trentm @twhiteman

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 in
container.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 as defaultMemory in this case).
@misterdjules
Copy link
Contributor Author

@joshwilsdon Updated the changes according to your code review, thank you :)

@joshwilsdon
Copy link
Contributor

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

@misterdjules
Copy link
Contributor Author

@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 :)

misterdjules pushed a commit that referenced this pull request Jul 13, 2015
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 in
container.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 as defaultMemory in this case).

PR: #43
PR-URL: #43
Reviewed-By: Josh Wilsdon <jwilsdon@joyent.com>
@misterdjules
Copy link
Contributor Author

Landed in c0cc2ee. Thank you @joshwilsdon 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants