(key string, containerID string, controllerID string)
| 1288 | } |
| 1289 | |
| 1290 | func reexecSetKey(key string, containerID string, controllerID string) error { |
| 1291 | type libcontainerState struct { |
| 1292 | NamespacePaths map[string]string |
| 1293 | } |
| 1294 | var ( |
| 1295 | state libcontainerState |
| 1296 | b []byte |
| 1297 | err error |
| 1298 | ) |
| 1299 | |
| 1300 | state.NamespacePaths = make(map[string]string) |
| 1301 | state.NamespacePaths["NEWNET"] = key |
| 1302 | if b, err = json.Marshal(state); err != nil { |
| 1303 | return err |
| 1304 | } |
| 1305 | cmd := &exec.Cmd{ |
| 1306 | Path: reexec.Self(), |
| 1307 | Args: append([]string{"libnetwork-setkey"}, containerID, controllerID), |
| 1308 | Stdin: strings.NewReader(string(b)), |
| 1309 | Stdout: os.Stdout, |
| 1310 | Stderr: os.Stderr, |
| 1311 | } |
| 1312 | return cmd.Run() |
| 1313 | } |
| 1314 | |
| 1315 | func TestResolvConf(t *testing.T) { |
| 1316 | tmpDir := t.TempDir() |
no test coverage detected
searching dependent graphs…