| 45 | } |
| 46 | |
| 47 | func 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 |