backend_unsupported.go 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //go:build !linux
  2. package plugin // import "github.com/docker/docker/plugin"
  3. import (
  4. "context"
  5. "errors"
  6. "io"
  7. "net/http"
  8. "github.com/distribution/reference"
  9. "github.com/docker/docker/api/types"
  10. "github.com/docker/docker/api/types/filters"
  11. "github.com/docker/docker/api/types/registry"
  12. )
  13. var errNotSupported = errors.New("plugins are not supported on this platform")
  14. // Disable deactivates a plugin, which implies that they cannot be used by containers.
  15. func (pm *Manager) Disable(name string, config *types.PluginDisableConfig) error {
  16. return errNotSupported
  17. }
  18. // Enable activates a plugin, which implies that they are ready to be used by containers.
  19. func (pm *Manager) Enable(name string, config *types.PluginEnableConfig) error {
  20. return errNotSupported
  21. }
  22. // Inspect examines a plugin config
  23. func (pm *Manager) Inspect(refOrID string) (tp *types.Plugin, err error) {
  24. return nil, errNotSupported
  25. }
  26. // Privileges pulls a plugin config and computes the privileges required to install it.
  27. func (pm *Manager) Privileges(ctx context.Context, ref reference.Named, metaHeader http.Header, authConfig *registry.AuthConfig) (types.PluginPrivileges, error) {
  28. return nil, errNotSupported
  29. }
  30. // Pull pulls a plugin, check if the correct privileges are provided and install the plugin.
  31. func (pm *Manager) Pull(ctx context.Context, ref reference.Named, name string, metaHeader http.Header, authConfig *registry.AuthConfig, privileges types.PluginPrivileges, out io.Writer, opts ...CreateOpt) error {
  32. return errNotSupported
  33. }
  34. // Upgrade pulls a plugin, check if the correct privileges are provided and install the plugin.
  35. func (pm *Manager) Upgrade(ctx context.Context, ref reference.Named, name string, metaHeader http.Header, authConfig *registry.AuthConfig, privileges types.PluginPrivileges, outStream io.Writer) error {
  36. return errNotSupported
  37. }
  38. // List displays the list of plugins and associated metadata.
  39. func (pm *Manager) List(pluginFilters filters.Args) ([]types.Plugin, error) {
  40. return nil, errNotSupported
  41. }
  42. // Push pushes a plugin to the store.
  43. func (pm *Manager) Push(ctx context.Context, name string, metaHeader http.Header, authConfig *registry.AuthConfig, out io.Writer) error {
  44. return errNotSupported
  45. }
  46. // Remove deletes plugin's root directory.
  47. func (pm *Manager) Remove(name string, config *types.PluginRmConfig) error {
  48. return errNotSupported
  49. }
  50. // Set sets plugin args
  51. func (pm *Manager) Set(name string, args []string) error {
  52. return errNotSupported
  53. }
  54. // CreateFromContext creates a plugin from the given pluginDir which contains
  55. // both the rootfs and the config.json and a repoName with optional tag.
  56. func (pm *Manager) CreateFromContext(ctx context.Context, tarCtx io.ReadCloser, options *types.PluginCreateOptions) error {
  57. return errNotSupported
  58. }