backend_unsupported.go 2.8 KB

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