api/types: remove errdefs dependency

This prevents projects that import only the api/types package from
also having to use the errdefs package (and because of that, containerd)
as a dependency.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-06-04 12:14:16 +02:00
parent 89382f2f20
commit a1afad3aab
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
2 changed files with 2 additions and 3 deletions

View file

@ -30,7 +30,7 @@ func (n *networkRouter) getNetworksList(ctx context.Context, w http.ResponseWrit
} }
if err := network.ValidateFilters(filter); err != nil { if err := network.ValidateFilters(filter); err != nil {
return err return errdefs.InvalidParameter(err)
} }
var list []types.NetworkResource var list []types.NetworkResource

View file

@ -1,7 +1,6 @@
package network // import "github.com/docker/docker/api/types/network" package network // import "github.com/docker/docker/api/types/network"
import ( import (
"github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/filters"
"github.com/docker/docker/errdefs"
) )
// Address represents an IP address // Address represents an IP address
@ -123,5 +122,5 @@ var acceptedFilters = map[string]bool{
// ValidateFilters validates the list of filter args with the available filters. // ValidateFilters validates the list of filter args with the available filters.
func ValidateFilters(filter filters.Args) error { func ValidateFilters(filter filters.Args) error {
return errdefs.InvalidParameter(filter.Validate(acceptedFilters)) return filter.Validate(acceptedFilters)
} }