MCPcopy Create free account
hub / github.com/containerd/nerdctl / loadSpec

Function loadSpec

pkg/ocihook/ocihook.go:278–289  ·  view source on GitHub ↗

loadSpec is from https://github.com/containerd/containerd/blob/v1.4.3/cmd/containerd/command/oci-hook.go#L65-L76

(bundle string)

Source from the content-addressed store, hash-verified

276
277// loadSpec is from https://github.com/containerd/containerd/blob/v1.4.3/cmd/containerd/command/oci-hook.go#L65-L76
278func loadSpec(bundle string) (*hookSpec, error) {
279 f, err := os.Open(filepath.Join(bundle, "config.json"))
280 if err != nil {
281 return nil, err
282 }
283 defer f.Close()
284 var s hookSpec
285 if err := json.NewDecoder(f).Decode(&s); err != nil {
286 return nil, err
287 }
288 return &s, nil
289}
290
291func getExtraHosts(state *specs.State) (map[string]string, error) {
292 extraHostsJSON := state.Annotations[labels.ExtraHosts]

Callers 1

newHandlerOptsFunction · 0.85

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…