From 36cf93fb0c45ce62b3cb1e82e1ecae1486017c9b Mon Sep 17 00:00:00 2001 From: Anusha Ragunathan Date: Fri, 19 Aug 2016 18:01:14 -0700 Subject: [PATCH] Add spec file support for Windows plugin discovery. Plugin discovery on Windows is not possible using named pipes. However, it is possible using spec file (tcp based). This adds Windows specific paths for discovery. Fixes #23605 Signed-off-by: Anusha Ragunathan --- pkg/plugins/discovery.go | 1 - pkg/plugins/discovery_unix.go | 3 +++ pkg/plugins/discovery_windows.go | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 pkg/plugins/discovery_unix.go create mode 100644 pkg/plugins/discovery_windows.go diff --git a/pkg/plugins/discovery.go b/pkg/plugins/discovery.go index 4297612be0..e99581c573 100644 --- a/pkg/plugins/discovery.go +++ b/pkg/plugins/discovery.go @@ -16,7 +16,6 @@ var ( // ErrNotFound plugin not found ErrNotFound = errors.New("plugin not found") socketsPath = "/run/docker/plugins" - specsPaths = []string{"/etc/docker/plugins", "/usr/lib/docker/plugins"} ) // localRegistry defines a registry that is local (using unix socket). diff --git a/pkg/plugins/discovery_unix.go b/pkg/plugins/discovery_unix.go new file mode 100644 index 0000000000..007d6185ee --- /dev/null +++ b/pkg/plugins/discovery_unix.go @@ -0,0 +1,3 @@ +package plugins + +var specsPaths = []string{"/etc/docker/plugins", "/usr/lib/docker/plugins"} diff --git a/pkg/plugins/discovery_windows.go b/pkg/plugins/discovery_windows.go new file mode 100644 index 0000000000..59b35d3e91 --- /dev/null +++ b/pkg/plugins/discovery_windows.go @@ -0,0 +1,8 @@ +package plugins + +import ( + "os" + "path/filepath" +) + +var specPaths = []string{filepath.Join(os.Getenv("programdata"), "docker", "plugins")}