(state *specs.State)
| 289 | } |
| 290 | |
| 291 | func getExtraHosts(state *specs.State) (map[string]string, error) { |
| 292 | extraHostsJSON := state.Annotations[labels.ExtraHosts] |
| 293 | var extraHosts []string |
| 294 | if err := json.Unmarshal([]byte(extraHostsJSON), &extraHosts); err != nil { |
| 295 | return nil, err |
| 296 | } |
| 297 | |
| 298 | hosts := make(map[string]string) |
| 299 | for _, host := range extraHosts { |
| 300 | if v := strings.SplitN(host, ":", 2); len(v) == 2 { |
| 301 | hosts[v[0]] = v[1] |
| 302 | } |
| 303 | } |
| 304 | return hosts, nil |
| 305 | } |
| 306 | |
| 307 | func getNetNSPath(state *specs.State) (string, error) { |
| 308 | // If we have a network-namespace annotation we use it over the passed Pid. |
no test coverage detected
searching dependent graphs…