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

Function loadBaseOCISpecs

plugins/cri/runtime/plugin.go:137–158  ·  view source on GitHub ↗
(config *criconfig.Config)

Source from the content-addressed store, hash-verified

135}
136
137func loadBaseOCISpecs(config *criconfig.Config) (map[string]*oci.Spec, error) {
138 specs := map[string]*oci.Spec{}
139 for _, cfg := range config.Runtimes {
140 if cfg.BaseRuntimeSpec == "" {
141 continue
142 }
143
144 // Don't load same file twice
145 if _, ok := specs[cfg.BaseRuntimeSpec]; ok {
146 continue
147 }
148
149 spec, err := loadOCISpec(cfg.BaseRuntimeSpec)
150 if err != nil {
151 return nil, fmt.Errorf("failed to load base OCI spec from file: %s: %w", cfg.BaseRuntimeSpec, err)
152 }
153
154 specs[cfg.BaseRuntimeSpec] = spec
155 }
156
157 return specs, nil
158}
159
160func loadOCISpec(filename string) (*oci.Spec, error) {
161 file, err := os.Open(filename)

Callers 2

TestLoadBaseOCISpecFunction · 0.85
initCRIRuntimeFunction · 0.85

Calls 1

loadOCISpecFunction · 0.85

Tested by 1

TestLoadBaseOCISpecFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…