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:
parent
89382f2f20
commit
a1afad3aab
2 changed files with 2 additions and 3 deletions
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue