Skip to content

Commit e9779fd

Browse files
anusha-ragunathanvieux
authored andcommitted
Fix pluginv1 Windows volumes
c54b717 caused a regression for pluginv1 on Windows, where extraneous backslashes were added to BasePath of the plugin. For pluginv1 on windows, BasePath() should return an empty string, since the plugin is fully aware of the mount path. Also, unlike Linux where all paths are relative to "/", Windows paths are dependent on system drives and mapped drives. Fixes moby#30148 Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com> (cherry picked from commit 0ef21eb) Signed-off-by: Victor Vieux <vieux@docker.com>
1 parent 2dd2ac2 commit e9779fd

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

pkg/plugins/plugins.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ type Plugin struct {
7878
handlersRun bool
7979
}
8080

81-
// BasePath returns the path to which all paths returned by the plugin are relative to.
82-
// For v1 plugins, this always returns the host's root directory.
83-
func (p *Plugin) BasePath() string {
84-
return "/"
85-
}
86-
8781
// Name returns the name of the plugin.
8882
func (p *Plugin) Name() string {
8983
return p.name

pkg/plugins/plugins_linux.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package plugins
2+
3+
// BasePath returns the path to which all paths returned by the plugin are relative to.
4+
// For v1 plugins, this always returns the host's root directory.
5+
func (p *Plugin) BasePath() string {
6+
return "/"
7+
}

pkg/plugins/plugins_windows.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package plugins
2+
3+
// BasePath returns the path to which all paths returned by the plugin are relative to.
4+
// For Windows v1 plugins, this returns an empty string, since the plugin is already aware
5+
// of the absolute path of the mount.
6+
func (p *Plugin) BasePath() string {
7+
return ""
8+
}

0 commit comments

Comments
 (0)