MCPcopy Index your code
hub / github.com/docker/cli / resolveNetworks

Function resolveNetworks

cli/command/service/formatter.go:209–219  ·  view source on GitHub ↗
(service swarm.Service, getNetwork inspect.GetRefFunc)

Source from the content-addressed store, hash-verified

207}
208
209func resolveNetworks(service swarm.Service, getNetwork inspect.GetRefFunc) map[string]string {
210 networkNames := make(map[string]string)
211 for _, nw := range service.Spec.TaskTemplate.Networks {
212 if resolved, _, err := getNetwork(nw.Target); err == nil {
213 if resolvedNetwork, ok := resolved.(network.Summary); ok {
214 networkNames[resolvedNetwork.ID] = resolvedNetwork.Name
215 }
216 }
217 }
218 return networkNames
219}
220
221// inspectFormatWrite renders the context for a list of services
222func inspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef, getNetwork inspect.GetRefFunc) error {

Callers 1

inspectFormatWriteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…