MCPcopy
hub / github.com/containerd/containerd / fifoFromProcessEnv

Function fifoFromProcessEnv

integration/failpoint/cmd/runc-fp/delayexec.go:70–94  ·  view source on GitHub ↗

fifoFromProcessEnv finds a fifo specified in the environment variables of an exec process

()

Source from the content-addressed store, hash-verified

68
69// fifoFromProcessEnv finds a fifo specified in the environment variables of an exec process
70func fifoFromProcessEnv() (fifosync.Trigger, fifosync.Waiter, error) {
71 env, err := processEnvironment()
72 if err != nil {
73 return nil, nil, err
74 }
75
76 readyName, ok := env[failpoint.DelayExecReadyEnv]
77 if !ok {
78 return nil, nil, fmt.Errorf("fifo: failed to find %q env var in %v", failpoint.DelayExecReadyEnv, env)
79 }
80 delayName, ok := env[failpoint.DelayExecDelayEnv]
81 if !ok {
82 return nil, nil, fmt.Errorf("fifo: failed to find %q env var in %v", failpoint.DelayExecDelayEnv, env)
83 }
84 logrus.WithField("ready", readyName).WithField("delay", delayName).Debug("Found FIFOs!")
85 readyFIFO, err := fifosync.NewTrigger(readyName, 0600)
86 if err != nil {
87 return nil, nil, err
88 }
89 delayFIFO, err := fifosync.NewWaiter(delayName, 0600)
90 if err != nil {
91 return nil, nil, err
92 }
93 return readyFIFO, delayFIFO, nil
94}
95
96func processEnvironment() (map[string]string, error) {
97 idx := 2

Callers 1

delayFunction · 0.85

Calls 3

NewTriggerFunction · 0.92
NewWaiterFunction · 0.92
processEnvironmentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…