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

Function convertDriverOpt

cli/command/network/connect.go:88–100  ·  view source on GitHub ↗
(options []string)

Source from the content-addressed store, hash-verified

86}
87
88func convertDriverOpt(options []string) (map[string]string, error) {
89 driverOpt := make(map[string]string)
90 for _, opt := range options {
91 k, v, ok := strings.Cut(opt, "=")
92 // TODO(thaJeztah): we should probably not accept whitespace here (both for key and value).
93 k = strings.TrimSpace(k)
94 if !ok || k == "" {
95 return nil, errors.New("invalid key/value pair format in driver options")
96 }
97 driverOpt[k] = strings.TrimSpace(v)
98 }
99 return driverOpt, nil
100}
101
102func toNetipAddrSlice(ips []net.IP) []netip.Addr {
103 if len(ips) == 0 {

Callers 1

runConnectFunction · 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…