engine-api icon indicating copy to clipboard operation
engine-api copied to clipboard

NetworkInspectWithRaw returns no corresponding types.NetworkResource and []byte !

Open allencloud opened this issue 9 years ago • 3 comments

Hi, All,

Today, I found that docker network inspect NETWORK shows engine details when this command is against Swarm.

See https://github.com/docker/swarm/issues/2349 and https://github.com/docker/swarm/pull/2275

In the response of NetworkInspectWithRaw from Swarm, there is additional Engine field in it. And dockercli implemented by github.com/spf13/cobra takes []byte to format the output. If the initial purpose of NetworkInspectWithRaw, is it []byte should be exactly correspond to types.NetworkResource.

func (cli *Client) NetworkInspectWithRaw(ctx context.Context, networkID string) (types.NetworkResource, []byte, error)

If the answer is yes, I think we should fix this. Maybe I can do the change.

allencloud avatar Jun 30 '16 13:06 allencloud

The response returned by this endpoint should match the type, yes. I think we need to fix the type.

dnephin avatar Jun 30 '16 15:06 dnephin

#dibs

allencloud avatar Jun 30 '16 15:06 allencloud

Yes we should make swarm API same as docker API.

dongluochen avatar Jun 30 '16 17:06 dongluochen