MCPcopy Create free account
hub / github.com/linuxkit/linuxkit / getRuntimeConfig

Function getRuntimeConfig

pkg/init/cmd/service/prepare.go:47–61  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

45}
46
47func getRuntimeConfig(path string) Runtime {
48 var runtime Runtime
49 conf, err := os.ReadFile(filepath.Join(path, "runtime.json"))
50 if err != nil {
51 // if it does not exist it is fine to return an empty runtime, to not do anything
52 if os.IsNotExist(err) {
53 return runtime
54 }
55 log.Fatalf("Cannot read runtime config: %v", err)
56 }
57 if err := json.Unmarshal(conf, &runtime); err != nil {
58 log.Fatalf("Cannot parse runtime config: %v", err)
59 }
60 return runtime
61}
62
63// parseMountOptions takes fstab style mount options and parses them for
64// use with a standard mount() syscall

Callers 3

stopFunction · 0.85
startFunction · 0.85
runcInitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected