make testclient more precise
This commit is contained in:
@@ -29,42 +29,78 @@ type FakeNamespaces struct {
|
||||
Fake *Fake
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) List(labels labels.Selector, field fields.Selector) (*api.NamespaceList, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "list-namespaces"}, &api.NamespaceList{})
|
||||
func (c *FakeNamespaces) Get(name string) (*api.Namespace, error) {
|
||||
obj, err := c.Fake.Invokes(NewRootGetAction("namespaces", name), &api.Namespace{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Namespace), err
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) List(label labels.Selector, field fields.Selector) (*api.NamespaceList, error) {
|
||||
obj, err := c.Fake.Invokes(NewRootListAction("namespaces", label, field), &api.NamespaceList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.NamespaceList), err
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) Get(name string) (*api.Namespace, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "get-namespace", Value: name}, &api.Namespace{})
|
||||
func (c *FakeNamespaces) Create(namespace *api.Namespace) (*api.Namespace, error) {
|
||||
obj, err := c.Fake.Invokes(NewRootCreateAction("namespaces", namespace), namespace)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Namespace), c.Fake.Err()
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) Update(namespace *api.Namespace) (*api.Namespace, error) {
|
||||
obj, err := c.Fake.Invokes(NewRootUpdateAction("namespaces", namespace), namespace)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Namespace), err
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(FakeAction{Action: "delete-namespace", Value: name}, &api.Namespace{})
|
||||
_, err := c.Fake.Invokes(NewRootDeleteAction("namespaces", name), &api.Namespace{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) Create(namespace *api.Namespace) (*api.Namespace, error) {
|
||||
c.Fake.Invokes(FakeAction{Action: "create-namespace"}, nil)
|
||||
return &api.Namespace{}, c.Fake.Err()
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) Update(namespace *api.Namespace) (*api.Namespace, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-namespace", Value: namespace}, &api.Namespace{})
|
||||
return obj.(*api.Namespace), err
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
c.Fake.Invokes(FakeAction{Action: "watch-namespaces", Value: resourceVersion}, nil)
|
||||
c.Fake.Invokes(NewRootWatchAction("namespaces", label, field, resourceVersion), nil)
|
||||
return c.Fake.Watch, nil
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) Finalize(namespace *api.Namespace) (*api.Namespace, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "finalize-namespace", Value: namespace}, &api.Namespace{})
|
||||
action := CreateActionImpl{}
|
||||
action.Verb = "create"
|
||||
action.Resource = "namespaces"
|
||||
action.Subresource = "finalize"
|
||||
action.Object = namespace
|
||||
|
||||
obj, err := c.Fake.Invokes(action, namespace)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Namespace), err
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) Status(namespace *api.Namespace) (*api.Namespace, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "status-namespace", Value: namespace}, &api.Namespace{})
|
||||
action := CreateActionImpl{}
|
||||
action.Verb = "create"
|
||||
action.Resource = "namespaces"
|
||||
action.Subresource = "status"
|
||||
action.Object = namespace
|
||||
|
||||
obj, err := c.Fake.Invokes(action, namespace)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Namespace), err
|
||||
}
|
||||
|
Reference in New Issue
Block a user