X Tutup
Skip to content

Moved "Memory", "MemorySwap" and "CpuShares" mappings from ContainerConfig to HostConfig#291

Merged
marcuslinke merged 2 commits intodocker-java:masterfrom
Khva0:master
Aug 26, 2015
Merged

Moved "Memory", "MemorySwap" and "CpuShares" mappings from ContainerConfig to HostConfig#291
marcuslinke merged 2 commits intodocker-java:masterfrom
Khva0:master

Conversation

@Khva0
Copy link
Copy Markdown
Contributor

@Khva0 Khva0 commented Aug 10, 2015

Moved "Memory", "MemorySwap" and "CpuShares" fields from ContainerConfig to HostConfig. This is to comply with current Docker Remote API (v1.18 and greater). On inspect command docker server returns json, where these fields are under "HostConfig" section, not "Config". See https://docs.docker.com/docker/reference/api/docker_remote_api_v1.19/#inspect-a-container

@KostyaSha
Copy link
Copy Markdown
Member

Description?

@Khva0
Copy link
Copy Markdown
Contributor Author

Khva0 commented Aug 10, 2015

Added description.

@KostyaSha
Copy link
Copy Markdown
Member

Will it be compatible with non 1.18 API?

@Khva0
Copy link
Copy Markdown
Contributor Author

Khva0 commented Aug 10, 2015

It is compatible with 1.18 and current 1.19 API. And README.md says that docker-java supports Docker Remote API v1.19, Docker Server version 1.7.x.

@KostyaSha
Copy link
Copy Markdown
Member

Supports = works on, but this doesn't clain that old APIs should be broken.

@Khva0
Copy link
Copy Markdown
Contributor Author

Khva0 commented Aug 10, 2015

Without this change it doesn't work on current API. That's why I made it.

@Khva0
Copy link
Copy Markdown
Contributor Author

Khva0 commented Aug 10, 2015

We either break current API compatibility or break old API compatibility. Docker-java declares compatibility with current API, thus choice is obvious.

@Khva0
Copy link
Copy Markdown
Contributor Author

Khva0 commented Aug 10, 2015

Whoever wants to use obsolete Docker version can use older version of Docker-java. Current Docker-java should work on current Docker.

@KostyaSha
Copy link
Copy Markdown
Member

Why is it a problem to @Deprecate old and use new?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use Long without default

@KostyaSha
Copy link
Copy Markdown
Member

👎 for primitives, breaking backward compatibility and default values

@Khva0
Copy link
Copy Markdown
Contributor Author

Khva0 commented Aug 11, 2015

I just moved few fields and corresponding getters from one class to another to comply with changes in docker API. And i did it respecting existing code conventions regarding primitives and default values.

@marcuslinke
Copy link
Copy Markdown
Contributor

While trying to merge this PR I found other inconsistencies regarding HostConfig object. Sadly the remote API documentation seems to be out of sync with the current implementation...

marcuslinke added a commit that referenced this pull request Aug 26, 2015
Moved "Memory", "MemorySwap" and "CpuShares" mappings from ContainerConfig to HostConfig
@marcuslinke marcuslinke merged commit 140e8db into docker-java:master Aug 26, 2015
@marcuslinke
Copy link
Copy Markdown
Contributor

Thanks for your contribution. I will fix remaining HostConfig inconsistencies with a separate PR.

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.

3 participants

X Tutup