Explorar o código

pkg/plugins: move Plugin.ScopedPath to platform-agnostic file

Since 0e5eaf8ee32662182147f5f62c1bfebef66f5c47, these implementations
were fully identical, so removing the duplicate, and move it to a
platform-agnostic file.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn hai 1 ano
pai
achega
20889dbac6
Modificáronse 3 ficheiros con 6 adicións e 16 borrados
  1. 6 0
      pkg/plugins/plugins.go
  2. 0 9
      pkg/plugins/plugins_unix.go
  3. 0 7
      pkg/plugins/plugins_windows.go

+ 6 - 0
pkg/plugins/plugins.go

@@ -101,6 +101,12 @@ func (p *Plugin) IsV1() bool {
 	return true
 	return true
 }
 }
 
 
+// ScopedPath returns the path scoped to the plugin's rootfs.
+// For v1 plugins, this always returns the path unchanged as v1 plugins run directly on the host.
+func (p *Plugin) ScopedPath(s string) string {
+	return s
+}
+
 // NewLocalPlugin creates a new local plugin.
 // NewLocalPlugin creates a new local plugin.
 func NewLocalPlugin(name, addr string) *Plugin {
 func NewLocalPlugin(name, addr string) *Plugin {
 	return &Plugin{
 	return &Plugin{

+ 0 - 9
pkg/plugins/plugins_unix.go

@@ -1,9 +0,0 @@
-//go:build !windows
-
-package plugins // import "github.com/docker/docker/pkg/plugins"
-
-// ScopedPath returns the path scoped to the plugin's rootfs.
-// For v1 plugins, this always returns the path unchanged as v1 plugins run directly on the host.
-func (p *Plugin) ScopedPath(s string) string {
-	return s
-}

+ 0 - 7
pkg/plugins/plugins_windows.go

@@ -1,7 +0,0 @@
-package plugins // import "github.com/docker/docker/pkg/plugins"
-
-// ScopedPath returns the path scoped to the plugin's rootfs.
-// For v1 plugins, this always returns the path unchanged as v1 plugins run directly on the host.
-func (p *Plugin) ScopedPath(s string) string {
-	return s
-}