mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 06:02:18 +00:00
Errors should be part of api/errors, not apiserver
Renames constructor methods to be errors.New<name> which changed a few places.
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
||||
)
|
||||
@@ -40,17 +41,17 @@ func NewBindingStorage(bindingRegistry Registry) *BindingStorage {
|
||||
|
||||
// List returns an error because bindings are write-only objects.
|
||||
func (*BindingStorage) List(selector labels.Selector) (interface{}, error) {
|
||||
return nil, apiserver.NewNotFoundErr("binding", "list")
|
||||
return nil, errors.NewNotFound("binding", "list")
|
||||
}
|
||||
|
||||
// Get returns an error because bindings are write-only objects.
|
||||
func (*BindingStorage) Get(id string) (interface{}, error) {
|
||||
return nil, apiserver.NewNotFoundErr("binding", id)
|
||||
return nil, errors.NewNotFound("binding", id)
|
||||
}
|
||||
|
||||
// Delete returns an error because bindings are write-only objects.
|
||||
func (*BindingStorage) Delete(id string) (<-chan interface{}, error) {
|
||||
return nil, apiserver.NewNotFoundErr("binding", id)
|
||||
return nil, errors.NewNotFound("binding", id)
|
||||
}
|
||||
|
||||
// New returns a new binding object fit for having data unmarshalled into it.
|
||||
|
Reference in New Issue
Block a user