Skip to content

Docker Swarm Inspect Container Info Support - #459

Closed
gerdogdu wants to merge 2 commits into
docker-java:masterfrom
gerdogdu:master
Closed

Docker Swarm Inspect Container Info Support#459
gerdogdu wants to merge 2 commits into
docker-java:masterfrom
gerdogdu:master

Conversation

@gerdogdu

Copy link
Copy Markdown

Fixes #458 .

When using Docker Swarm, containers/{id}/json does not contains Node information. This reqeust adds Node related information to the InspectContainerResponse.

Review on Reviewable

Signed-off-by: Gurkan Erdogdu <gerdogdu@managecat.com>
@KostyaSha

Copy link
Copy Markdown
Member

Sorry, but swarm support will be delayed to 3.1.0. Plus it would require integration and functional tests. Change of the field name smells like regression for non swarm containers.

@xbkaishui

Copy link
Copy Markdown

hi gerdogdu , swam related api I can't see in master branch

@KostyaSha KostyaSha added this to the 3.1.0 milestone Feb 26, 2016
private String name;

@JsonProperty("Id")
@JsonProperty("ID")

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.

That would break backward compatibility if this field was right and contains data for docker API before.

@suryagaddipati suryagaddipati Jun 20, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So Looks like Node is currently being used in Event response.

But I can't seem to find where event response sends a node. I looked at 1.23 and 1.18 none of those events have Node.

I am confused 1. why its there 2. what kind of backward compatibility this would be breaking.

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.

It may happen that different calls has different internals in the same Node object, then it should be splitted.
If Id exists in docker api, then you can't just remove it.

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.

@suryagaddipati A node as returned by the /events API, for instance, when Swarm is used.
then it may be that swarm changed API. You should try get responces from 2 different swarm versions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Swarm Node always had the same api response, there is no difference between versions.

Can you link me to where swarm node api changed? I can't seem to find it, perhaps I missed it.

@KostyaSha KostyaSha Jun 20, 2016

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.

https://docs.docker.com/swarm/swarm-api/

"Node": {
    "Id": "ODAI:IC6Q:MSBL:TPB5:HIEE:6IKC:VCAM:QRNH:PRGX:ERZT:OK46:PMFX",
    "Ip": "0.0.0.0",

Smells like Node is reused... will verify and think on creating ITs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hi @KostyaSha those docs seem out of date

https://github.com/docker/swarm/blob/master/scheduler/node/node.go#L11-L12

the case did indeed seems to have been changed by this commit, like you suspected.

probably a good idea to change Node class to have both fields and return the one that is not null. what do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@KostyaSha i created an issue on docker swarm docker-archive/classicswarm#2378
to clarify the breaking changes.

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.

Looks like they fixed docs.

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.

So i would suggest to make new SwarmNode class as it seems that it fully other Node objects and current docker Node class shouldn't be changed.

@suryagaddipati

suryagaddipati commented Jun 20, 2016

Copy link
Copy Markdown
Contributor

hi @KostyaSha thank you for your quick response.

What can I help do to get this merged? Looks like this PR has been open for over 4 months( which like 4 yrs in dockerland :)) .

@KostyaSha

Copy link
Copy Markdown
Member

tests

@KostyaSha

Copy link
Copy Markdown
Member

And review my comment about IDs, changing something just for swarm shouldn't break docker api.

@KostyaSha

Copy link
Copy Markdown
Member

#383 related.

@codecov-io

Copy link
Copy Markdown

Current coverage is 23.39% (diff: 0.00%)

No coverage report found for master at 8be5180.

Powered by Codecov. Last update 8be5180...940b4a1

@KostyaSha

Copy link
Copy Markdown
Member

#711 is what i expected :( but only now got time.

@KostyaSha

Copy link
Copy Markdown
Member

AFAIR everything is in master...

@KostyaSha KostyaSha closed this Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants