MCPcopy Create free account
hub / github.com/containerd/containerd / loadOCISpec

Function loadOCISpec

plugins/cri/runtime/plugin.go:160–173  ·  view source on GitHub ↗
(filename string)

Source from the content-addressed store, hash-verified

158}
159
160func loadOCISpec(filename string) (*oci.Spec, error) {
161 file, err := os.Open(filename)
162 if err != nil {
163 return nil, fmt.Errorf("failed to open base OCI spec: %s: %w", filename, err)
164 }
165 defer file.Close()
166
167 spec := oci.Spec{}
168 if err := json.NewDecoder(file).Decode(&spec); err != nil {
169 return nil, fmt.Errorf("failed to parse base OCI spec file: %w", err)
170 }
171
172 return &spec, nil
173}
174
175// Set glog level.
176// TODO: mikebrow remove this klog inititialization func once we are no longer vendoring k8s.io/klog

Callers 1

loadBaseOCISpecsFunction · 0.85

Calls 3

DecodeMethod · 0.80
CloseMethod · 0.65
OpenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…