MCPcopy
hub / github.com/moby/moby / reexecSetKey

Function reexecSetKey

daemon/libnetwork/libnetwork_linux_test.go:1290–1313  ·  view source on GitHub ↗
(key string, containerID string, controllerID string)

Source from the content-addressed store, hash-verified

1288}
1289
1290func 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
1315func TestResolvConf(t *testing.T) {
1316 tmpDir := t.TempDir()

Callers 1

externalKeyTestFunction · 0.85

Calls 2

RunMethod · 0.65
MarshalMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…