Merge pull request #7894 from my-git9/cleanup/errdefs

reused package errdefs for error
This commit is contained in:
Derek McGowan 2023-01-02 11:57:58 -08:00 committed by GitHub
commit 5e2b7c5b7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -33,7 +33,7 @@ limitations under the License.
package bandwidth
import (
"errors"
"github.com/containerd/containerd/errdefs"
"k8s.io/apimachinery/pkg/api/resource"
)
@ -47,7 +47,7 @@ type FakeShaper struct {
// Limit is not implemented
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
@ -58,12 +58,12 @@ func (f *FakeShaper) Reset(cidr string) error {
// ReconcileInterface is not implemented
func (f *FakeShaper) ReconcileInterface() error {
return errors.New("unimplemented")
return errdefs.ErrNotImplemented
}
// ReconcileCIDR is not implemented
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

View File

@ -35,7 +35,7 @@ limitations under the License.
package bandwidth
import (
"errors"
"github.com/containerd/containerd/errdefs"
"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 {
return errors.New("unimplemented")
return errdefs.ErrNotImplemented
}
func (f *unsupportedShaper) Reset(cidr string) error {
@ -57,11 +57,11 @@ func (f *unsupportedShaper) Reset(cidr string) error {
}
func (f *unsupportedShaper) ReconcileInterface() error {
return errors.New("unimplemented")
return errdefs.ErrNotImplemented
}
func (f *unsupportedShaper) ReconcileCIDR(cidr string, egress, ingress *resource.Quantity) error {
return errors.New("unimplemented")
return errdefs.ErrNotImplemented
}
func (f *unsupportedShaper) GetCIDRs() ([]string, error) {