diff options
author | Jason T. Greene <jason.greene@redhat.com> | 2022-03-24 22:07:55 -0500 |
---|---|---|
committer | Jason T. Greene <jason.greene@redhat.com> | 2022-04-25 13:52:27 -0500 |
commit | b0d36f63513ee64fa1c1eff4d1045a7633804f12 (patch) | |
tree | 3bb66bef188e12daae252a18234e544a9be1b145 /pkg/specgen/winpath_windows.go | |
parent | 3b6ffcd290978f5e0110e925c212d6396accee10 (diff) | |
download | podman-b0d36f63513ee64fa1c1eff4d1045a7633804f12.tar.gz podman-b0d36f63513ee64fa1c1eff4d1045a7633804f12.tar.bz2 podman-b0d36f63513ee64fa1c1eff4d1045a7633804f12.zip |
Implements Windows volume/mount support
Based on WSL2 9p support: remaps windows paths to /mnt/<drive> locations for
both podman and Docker API clients.
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
Diffstat (limited to 'pkg/specgen/winpath_windows.go')
-rw-r--r-- | pkg/specgen/winpath_windows.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/pkg/specgen/winpath_windows.go b/pkg/specgen/winpath_windows.go new file mode 100644 index 000000000..c6aad314a --- /dev/null +++ b/pkg/specgen/winpath_windows.go @@ -0,0 +1,30 @@ +package specgen + +import ( + "github.com/sirupsen/logrus" + "os" + "path/filepath" +) + +func shouldResolveUnixWinVariant(path string) bool { + return true +} + +func shouldResolveWinPaths() bool { + return true +} + +func resolveRelativeOnWindows(path string) string { + ret, err := filepath.Abs(path) + if err != nil { + logrus.Debugf("problem resolving possible relative path %q: %s", path, err.Error()) + return path + } + + return ret +} + +func winPathExists(path string) bool { + _, err := os.Stat(path) + return err == nil +} |