Skip to content

Commit

Permalink
fix verbose for partial overlay ID
Browse files Browse the repository at this point in the history
Signed-off-by: Dani Louca <dani.louca@docker.com>
  • Loading branch information
Dani Louca committed Jan 12, 2018
1 parent 92309e3 commit 7cb1c9e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/server/router/network/network_routes.go
Expand Up @@ -178,6 +178,13 @@ func (n *networkRouter) getNetwork(ctx context.Context, w http.ResponseWriter, r
// return the network. Skipped using isMatchingScope because it is true if the scope
// is not set which would be case if the client API v1.30
if strings.HasPrefix(nwk.ID, term) || (netconst.SwarmScope == scope) {
//If we have a previous match "backend", return it, we need verbose when enabled
//ex: overlay/partial_ID or name/swarm_scope
if nwv, ok := listByPartialID[nwk.ID]; ok {
nwk = nwv
} else if nwv, ok := listByFullName[nwk.ID]; ok {
nwk = nwv
}
return httputils.WriteJSON(w, http.StatusOK, nwk)
}
}
Expand Down

0 comments on commit 7cb1c9e

Please sign in to comment.