loadSpec is from https://github.com/containerd/containerd/blob/v1.4.3/cmd/containerd/command/oci-hook.go#L65-L76
(bundle string)
| 276 | |
| 277 | // loadSpec is from https://github.com/containerd/containerd/blob/v1.4.3/cmd/containerd/command/oci-hook.go#L65-L76 |
| 278 | func 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 | |
| 291 | func getExtraHosts(state *specs.State) (map[string]string, error) { |
| 292 | extraHostsJSON := state.Annotations[labels.ExtraHosts] |
no test coverage detected
searching dependent graphs…