MCPcopy
hub / github.com/containerd/containerd / writeBootstrapParams

Function writeBootstrapParams

core/runtime/v2/shim.go:253–276  ·  view source on GitHub ↗

writeBootstrapParams writes shim's bootstrap configuration (e.g. how to connect, version, etc).

(path string, params *bootapi.BootstrapResult)

Source from the content-addressed store, hash-verified

251
252// writeBootstrapParams writes shim's bootstrap configuration (e.g. how to connect, version, etc).
253func writeBootstrapParams(path string, params *bootapi.BootstrapResult) error {
254 path, err := filepath.Abs(path)
255 if err != nil {
256 return err
257 }
258
259 data, err := json.Marshal(&params)
260 if err != nil {
261 return err
262 }
263
264 f, err := atomicfile.New(path, 0o644)
265 if err != nil {
266 return err
267 }
268
269 _, err = f.Write(data)
270 if err != nil {
271 f.Cancel()
272 return err
273 }
274
275 return f.Close()
276}
277
278func readBootstrapParams(path string) (*bootapi.BootstrapResult, error) {
279 path, err := filepath.Abs(path)

Callers 3

StartMethod · 0.85
restoreBootstrapParamsFunction · 0.85
StartMethod · 0.85

Calls 5

NewFunction · 0.92
WriteMethod · 0.65
CancelMethod · 0.65
CloseMethod · 0.65
MarshalMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…