Merge pull request #7894 from my-git9/cleanup/errdefs
reused package errdefs for error
This commit is contained in:
		| @@ -33,7 +33,7 @@ limitations under the License. | |||||||
| package bandwidth | package bandwidth | ||||||
|  |  | ||||||
| import ( | import ( | ||||||
| 	"errors" | 	"github.com/containerd/containerd/errdefs" | ||||||
|  |  | ||||||
| 	"k8s.io/apimachinery/pkg/api/resource" | 	"k8s.io/apimachinery/pkg/api/resource" | ||||||
| ) | ) | ||||||
| @@ -47,7 +47,7 @@ type FakeShaper struct { | |||||||
|  |  | ||||||
| // Limit is not implemented | // Limit is not implemented | ||||||
| func (f *FakeShaper) Limit(cidr string, egress, ingress *resource.Quantity) error { | func (f *FakeShaper) Limit(cidr string, egress, ingress *resource.Quantity) error { | ||||||
| 	return errors.New("unimplemented") | 	return errdefs.ErrNotImplemented | ||||||
| } | } | ||||||
|  |  | ||||||
| // Reset appends a particular CIDR to the set of ResetCIDRs being managed by this shaper | // Reset appends a particular CIDR to the set of ResetCIDRs being managed by this shaper | ||||||
| @@ -58,12 +58,12 @@ func (f *FakeShaper) Reset(cidr string) error { | |||||||
|  |  | ||||||
| // ReconcileInterface is not implemented | // ReconcileInterface is not implemented | ||||||
| func (f *FakeShaper) ReconcileInterface() error { | func (f *FakeShaper) ReconcileInterface() error { | ||||||
| 	return errors.New("unimplemented") | 	return errdefs.ErrNotImplemented | ||||||
| } | } | ||||||
|  |  | ||||||
| // ReconcileCIDR is not implemented | // ReconcileCIDR is not implemented | ||||||
| func (f *FakeShaper) ReconcileCIDR(cidr string, egress, ingress *resource.Quantity) error { | func (f *FakeShaper) ReconcileCIDR(cidr string, egress, ingress *resource.Quantity) error { | ||||||
| 	return errors.New("unimplemented") | 	return errdefs.ErrNotImplemented | ||||||
| } | } | ||||||
|  |  | ||||||
| // GetCIDRs returns the set of CIDRs that are being managed by this shaper | // GetCIDRs returns the set of CIDRs that are being managed by this shaper | ||||||
|   | |||||||
| @@ -35,7 +35,7 @@ limitations under the License. | |||||||
| package bandwidth | package bandwidth | ||||||
|  |  | ||||||
| import ( | import ( | ||||||
| 	"errors" | 	"github.com/containerd/containerd/errdefs" | ||||||
|  |  | ||||||
| 	"k8s.io/apimachinery/pkg/api/resource" | 	"k8s.io/apimachinery/pkg/api/resource" | ||||||
| ) | ) | ||||||
| @@ -49,7 +49,7 @@ func NewTCShaper(iface string) Shaper { | |||||||
| } | } | ||||||
|  |  | ||||||
| func (f *unsupportedShaper) Limit(cidr string, egress, ingress *resource.Quantity) error { | func (f *unsupportedShaper) Limit(cidr string, egress, ingress *resource.Quantity) error { | ||||||
| 	return errors.New("unimplemented") | 	return errdefs.ErrNotImplemented | ||||||
| } | } | ||||||
|  |  | ||||||
| func (f *unsupportedShaper) Reset(cidr string) error { | func (f *unsupportedShaper) Reset(cidr string) error { | ||||||
| @@ -57,11 +57,11 @@ func (f *unsupportedShaper) Reset(cidr string) error { | |||||||
| } | } | ||||||
|  |  | ||||||
| func (f *unsupportedShaper) ReconcileInterface() error { | func (f *unsupportedShaper) ReconcileInterface() error { | ||||||
| 	return errors.New("unimplemented") | 	return errdefs.ErrNotImplemented | ||||||
| } | } | ||||||
|  |  | ||||||
| func (f *unsupportedShaper) ReconcileCIDR(cidr string, egress, ingress *resource.Quantity) error { | func (f *unsupportedShaper) ReconcileCIDR(cidr string, egress, ingress *resource.Quantity) error { | ||||||
| 	return errors.New("unimplemented") | 	return errdefs.ErrNotImplemented | ||||||
| } | } | ||||||
|  |  | ||||||
| func (f *unsupportedShaper) GetCIDRs() ([]string, error) { | func (f *unsupportedShaper) GetCIDRs() ([]string, error) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Derek McGowan
					Derek McGowan