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

Since 0e5eaf8ee3, 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>
This commit is contained in:
Sebastiaan van Stijn 2023-07-18 10:27:46 +02:00
parent e4134d5c0d
commit 20889dbac6
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
3 changed files with 6 additions and 16 deletions

View file

@ -101,6 +101,12 @@ func (p *Plugin) IsV1() bool {
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.
func NewLocalPlugin(name, addr string) *Plugin {
return &Plugin{

View file

@ -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
}

View file

@ -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
}