verbose info is missing for partial overlay ID#35989
Conversation
|
@dani-docker can you add a simple test to avoid that this api will end up broken again? |
|
This part of the code has really become way too complex; we should have a look at rewriting/refactoring |
| nwk = nwv | ||
| } else if nwv, ok := listByFullName[nwk.ID]; ok { | ||
| nwk = nwv | ||
| } |
There was a problem hiding this comment.
Is there a way to simplify these two conditions? The statements in these blocks are identical.
There was a problem hiding this comment.
On second thoughts, I think this code is fine.
7cb1c9e to
e907c52
Compare
|
@fcrisciani integration test is added.
btw, the swarm/service part is code copied from the service integration test. |
|
@dani-docker there is an import issue |
e907c52 to
c2c73c2
Compare
|
@fcrisciani |
There was a problem hiding this comment.
small nit, can you put a space after the // of the comment?
applies to both lines and also the test
There was a problem hiding this comment.
done, PR updated
fcrisciani
left a comment
There was a problem hiding this comment.
small code style nits, rest LGTM
Signed-off-by: Dani Louca <[email protected]>
c2c73c2 to
2e0990f
Compare
|
comment format adjusted and PR updated |
|
LGTM |
Signed-off-by: Dani Louca [email protected]
The changes in 34302 ignores the network details already collected in the previous
backendblock and causesdocker network inspect -v <overlay_partial_IDto miss the "extra details" provided by the verbose flag.The same issue exists with the network inspect API when querying a network overlay
nameandswarmscope, ex:curl --unix-socket /var/run/docker.sock "http:/v1.30/networks/<overlay_name>?verbose=true&scope=swarm"Steps To Reproduce:
docker network create -d overlay appsdocker service create --mode global --name runev --network apps alpine watch datedocker network ls -f driver=overlay -f name=apps -qdocker network inspect -v 6yiu2vo3objaExpected Results:
return all the extra info provided by the verbose flag, including endpoints, services etc...
Actual Results:
verbose information is missing
Same behavior applies to:
curl --unix-socket /var/run/docker.sock "http:/v1.30/networks/apps?verbose=true&scope=swarm"Fix:
The fix does not alter the behavior added in 34302, it checks if the networkID returned by
n.cluster.GetNetwork(term)has an entry inlistByPartialIDorlistByFullNameand returns it, otherwise it returns the basic network detail.