ResolveRelativePaths make relative paths absolute
(project map[string]any, base string, remotes []RemoteResource)
| 29 | |
| 30 | // ResolveRelativePaths make relative paths absolute |
| 31 | func ResolveRelativePaths(project map[string]any, base string, remotes []RemoteResource) error { |
| 32 | r := relativePathsResolver{ |
| 33 | workingDir: base, |
| 34 | remotes: remotes, |
| 35 | } |
| 36 | r.resolvers = map[tree.Path]resolver{ |
| 37 | "services.*.build.context": r.absContextPath, |
| 38 | "services.*.build.additional_contexts.*": r.absContextPath, |
| 39 | "services.*.build.ssh.*": r.maybeUnixPath, |
| 40 | "services.*.env_file.*.path": r.absPath, |
| 41 | "services.*.label_file.*": r.absPath, |
| 42 | "services.*.extends.file": r.absExtendsPath, |
| 43 | "services.*.develop.watch.*.path": r.absSymbolicLink, |
| 44 | "services.*.volumes.*": r.absVolumeMount, |
| 45 | "configs.*.file": r.maybeUnixPath, |
| 46 | "secrets.*.file": r.maybeUnixPath, |
| 47 | "include.path": r.absPath, |
| 48 | "include.project_directory": r.absPath, |
| 49 | "include.env_file": r.absPath, |
| 50 | "volumes.*": r.volumeDriverOpts, |
| 51 | } |
| 52 | _, err := r.resolveRelativePaths(project, tree.NewPath()) |
| 53 | return err |
| 54 | } |
| 55 | |
| 56 | type RemoteResource func(path string) bool |
| 57 |
no test coverage detected
searching dependent graphs…