MCPcopy Create free account
hub / github.com/docker/cli / resolveNetworkID

Function resolveNetworkID

cli/command/service/opts.go:417–423  ·  view source on GitHub ↗
(ctx context.Context, apiClient client.NetworkAPIClient, networkIDOrName string)

Source from the content-addressed store, hash-verified

415}
416
417func resolveNetworkID(ctx context.Context, apiClient client.NetworkAPIClient, networkIDOrName string) (string, error) {
418 res, err := apiClient.NetworkInspect(ctx, networkIDOrName, client.NetworkInspectOptions{Scope: "swarm"})
419 if err != nil {
420 return "", err
421 }
422 return res.Network.ID, nil
423}
424
425func convertNetworks(networks opts.NetworkOpt) []swarm.NetworkAttachmentConfig {
426 nws := networks.Value()

Callers 2

updateNetworksFunction · 0.85
ToServiceMethod · 0.85

Calls 1

NetworkInspectMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…