make testclient more precise
This commit is contained in:
279
pkg/client/testclient/actions.go
Normal file
279
pkg/client/testclient/actions.go
Normal file
@@ -0,0 +1,279 @@
|
||||
/*
|
||||
Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package testclient
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
func NewRootGetAction(resource, name string) GetActionImpl {
|
||||
action := GetActionImpl{}
|
||||
action.Verb = "get"
|
||||
action.Resource = resource
|
||||
action.Name = name
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func NewGetAction(resource, namespace, name string) GetActionImpl {
|
||||
action := GetActionImpl{}
|
||||
action.Verb = "get"
|
||||
action.Resource = resource
|
||||
action.Namespace = namespace
|
||||
action.Name = name
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func NewRootListAction(resource string, label labels.Selector, field fields.Selector) ListActionImpl {
|
||||
action := ListActionImpl{}
|
||||
action.Verb = "list"
|
||||
action.Resource = resource
|
||||
action.ListRestrictions = ListRestrictions{label, field}
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func NewListAction(resource, namespace string, label labels.Selector, field fields.Selector) ListActionImpl {
|
||||
action := ListActionImpl{}
|
||||
action.Verb = "list"
|
||||
action.Resource = resource
|
||||
action.Namespace = namespace
|
||||
action.ListRestrictions = ListRestrictions{label, field}
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func NewRootCreateAction(resource string, object runtime.Object) CreateActionImpl {
|
||||
action := CreateActionImpl{}
|
||||
action.Verb = "create"
|
||||
action.Resource = resource
|
||||
action.Object = object
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func NewCreateAction(resource, namespace string, object runtime.Object) CreateActionImpl {
|
||||
action := CreateActionImpl{}
|
||||
action.Verb = "create"
|
||||
action.Resource = resource
|
||||
action.Namespace = namespace
|
||||
action.Object = object
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func NewRootUpdateAction(resource string, object runtime.Object) UpdateActionImpl {
|
||||
action := UpdateActionImpl{}
|
||||
action.Verb = "update"
|
||||
action.Resource = resource
|
||||
action.Object = object
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func NewUpdateAction(resource, namespace string, object runtime.Object) UpdateActionImpl {
|
||||
action := UpdateActionImpl{}
|
||||
action.Verb = "update"
|
||||
action.Resource = resource
|
||||
action.Namespace = namespace
|
||||
action.Object = object
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func NewRootDeleteAction(resource, name string) DeleteActionImpl {
|
||||
action := DeleteActionImpl{}
|
||||
action.Verb = "delete"
|
||||
action.Resource = resource
|
||||
action.Name = name
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func NewDeleteAction(resource, namespace, name string) DeleteActionImpl {
|
||||
action := DeleteActionImpl{}
|
||||
action.Verb = "delete"
|
||||
action.Resource = resource
|
||||
action.Namespace = namespace
|
||||
action.Name = name
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func NewRootWatchAction(resource string, label labels.Selector, field fields.Selector, resourceVersion string) WatchActionImpl {
|
||||
action := WatchActionImpl{}
|
||||
action.Verb = "watch"
|
||||
action.Resource = resource
|
||||
action.WatchRestrictions = WatchRestrictions{label, field, resourceVersion}
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func NewWatchAction(resource, namespace string, label labels.Selector, field fields.Selector, resourceVersion string) WatchActionImpl {
|
||||
action := WatchActionImpl{}
|
||||
action.Verb = "watch"
|
||||
action.Resource = resource
|
||||
action.Namespace = namespace
|
||||
action.WatchRestrictions = WatchRestrictions{label, field, resourceVersion}
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
type ListRestrictions struct {
|
||||
Labels labels.Selector
|
||||
Fields fields.Selector
|
||||
}
|
||||
type WatchRestrictions struct {
|
||||
Labels labels.Selector
|
||||
Fields fields.Selector
|
||||
ResourceVersion string
|
||||
}
|
||||
|
||||
type Action interface {
|
||||
GetNamespace() string
|
||||
GetVerb() string
|
||||
GetResource() string
|
||||
GetSubresource() string
|
||||
Matches(verb, resource string) bool
|
||||
}
|
||||
|
||||
type GenericAction interface {
|
||||
Action
|
||||
GetValue() interface{}
|
||||
}
|
||||
|
||||
type GetAction interface {
|
||||
Action
|
||||
GetName() string
|
||||
}
|
||||
|
||||
type ListAction interface {
|
||||
Action
|
||||
GetListRestrictions() ListRestrictions
|
||||
}
|
||||
|
||||
type CreateAction interface {
|
||||
Action
|
||||
GetObject() runtime.Object
|
||||
}
|
||||
|
||||
type UpdateAction interface {
|
||||
Action
|
||||
GetObject() runtime.Object
|
||||
}
|
||||
|
||||
type DeleteAction interface {
|
||||
Action
|
||||
GetName() string
|
||||
}
|
||||
|
||||
type WatchAction interface {
|
||||
Action
|
||||
GetWatchRestrictions() WatchRestrictions
|
||||
}
|
||||
|
||||
type ActionImpl struct {
|
||||
Namespace string
|
||||
Verb string
|
||||
Resource string
|
||||
Subresource string
|
||||
}
|
||||
|
||||
func (a ActionImpl) GetNamespace() string {
|
||||
return a.Namespace
|
||||
}
|
||||
func (a ActionImpl) GetVerb() string {
|
||||
return a.Verb
|
||||
}
|
||||
func (a ActionImpl) GetResource() string {
|
||||
return a.Resource
|
||||
}
|
||||
func (a ActionImpl) GetSubresource() string {
|
||||
return a.Subresource
|
||||
}
|
||||
func (a ActionImpl) Matches(verb, resource string) bool {
|
||||
return strings.ToLower(verb) == strings.ToLower(a.Verb) &&
|
||||
strings.ToLower(resource) == strings.ToLower(a.Resource)
|
||||
}
|
||||
|
||||
type GenericActionImpl struct {
|
||||
ActionImpl
|
||||
Value interface{}
|
||||
}
|
||||
|
||||
func (a GenericActionImpl) GetValue() interface{} {
|
||||
return a.Value
|
||||
}
|
||||
|
||||
type GetActionImpl struct {
|
||||
ActionImpl
|
||||
Name string
|
||||
}
|
||||
|
||||
func (a GetActionImpl) GetName() string {
|
||||
return a.Name
|
||||
}
|
||||
|
||||
type ListActionImpl struct {
|
||||
ActionImpl
|
||||
ListRestrictions ListRestrictions
|
||||
}
|
||||
|
||||
func (a ListActionImpl) GetListRestrictions() ListRestrictions {
|
||||
return a.ListRestrictions
|
||||
}
|
||||
|
||||
type CreateActionImpl struct {
|
||||
ActionImpl
|
||||
Object runtime.Object
|
||||
}
|
||||
|
||||
func (a CreateActionImpl) GetObject() runtime.Object {
|
||||
return a.Object
|
||||
}
|
||||
|
||||
type UpdateActionImpl struct {
|
||||
ActionImpl
|
||||
Object runtime.Object
|
||||
}
|
||||
|
||||
func (a UpdateActionImpl) GetObject() runtime.Object {
|
||||
return a.Object
|
||||
}
|
||||
|
||||
type DeleteActionImpl struct {
|
||||
ActionImpl
|
||||
Name string
|
||||
}
|
||||
|
||||
func (a DeleteActionImpl) GetName() string {
|
||||
return a.Name
|
||||
}
|
||||
|
||||
type WatchActionImpl struct {
|
||||
ActionImpl
|
||||
WatchRestrictions WatchRestrictions
|
||||
}
|
||||
|
||||
func (a WatchActionImpl) GetWatchRestrictions() WatchRestrictions {
|
||||
return a.WatchRestrictions
|
||||
}
|
@@ -27,21 +27,20 @@ type FakeComponentStatuses struct {
|
||||
Fake *Fake
|
||||
}
|
||||
|
||||
func (c *FakeComponentStatuses) List(label labels.Selector, field fields.Selector) (result *api.ComponentStatusList, err error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "list-componentstatuses"}, &api.ComponentStatusList{})
|
||||
return obj.(*api.ComponentStatusList), err
|
||||
}
|
||||
|
||||
func (c *FakeComponentStatuses) Get(name string) (*api.ComponentStatus, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "get-componentstatus", Value: name}, &api.ComponentStatus{})
|
||||
// c.Actions = append(c.Actions, FakeAction{Action: "get-componentstatuses", Value: nil})
|
||||
// testStatus := &api.ComponentStatus{
|
||||
// Name: "test",
|
||||
// Health: "ok",
|
||||
// HealthCode: int(probe.Success),
|
||||
// Message: "ok",
|
||||
// Error: "",
|
||||
// }
|
||||
// return &api.ComponentStatusList{Items: []api.ComponentStatus{*testStatus}}, nil
|
||||
obj, err := c.Fake.Invokes(NewRootGetAction("componentstatuses", name), &api.ComponentStatus{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.ComponentStatus), err
|
||||
}
|
||||
|
||||
func (c *FakeComponentStatuses) List(label labels.Selector, field fields.Selector) (result *api.ComponentStatusList, err error) {
|
||||
obj, err := c.Fake.Invokes(NewRootListAction("componentstatuses", label, field), &api.ComponentStatusList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.ComponentStatusList), err
|
||||
}
|
||||
|
@@ -30,32 +30,48 @@ type FakeEndpoints struct {
|
||||
Namespace string
|
||||
}
|
||||
|
||||
func (c *FakeEndpoints) Create(endpoints *api.Endpoints) (*api.Endpoints, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "create-endpoints"}, &api.Endpoints{})
|
||||
func (c *FakeEndpoints) Get(name string) (*api.Endpoints, error) {
|
||||
obj, err := c.Fake.Invokes(NewGetAction("endpoints", c.Namespace, name), &api.Endpoints{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Endpoints), err
|
||||
}
|
||||
|
||||
func (c *FakeEndpoints) List(selector labels.Selector) (*api.EndpointsList, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "list-endpoints"}, &api.EndpointsList{})
|
||||
func (c *FakeEndpoints) List(label labels.Selector) (*api.EndpointsList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("endpoints", c.Namespace, label, nil), &api.EndpointsList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.EndpointsList), err
|
||||
}
|
||||
|
||||
func (c *FakeEndpoints) Get(name string) (*api.Endpoints, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "get-endpoints", Value: name}, &api.Endpoints{})
|
||||
func (c *FakeEndpoints) Create(endpoints *api.Endpoints) (*api.Endpoints, error) {
|
||||
obj, err := c.Fake.Invokes(NewCreateAction("endpoints", c.Namespace, endpoints), endpoints)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Endpoints), err
|
||||
}
|
||||
|
||||
func (c *FakeEndpoints) Update(endpoints *api.Endpoints) (*api.Endpoints, error) {
|
||||
obj, err := c.Fake.Invokes(NewUpdateAction("endpoints", c.Namespace, endpoints), endpoints)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Endpoints), err
|
||||
}
|
||||
|
||||
func (c *FakeEndpoints) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(FakeAction{Action: "delete-endpoints", Value: name}, &api.Endpoints{})
|
||||
_, err := c.Fake.Invokes(NewDeleteAction("endpoints", c.Namespace, name), &api.Endpoints{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeEndpoints) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
c.Fake.Invokes(FakeAction{Action: "watch-endpoints", Value: resourceVersion}, nil)
|
||||
c.Fake.Invokes(NewWatchAction("endpoints", c.Namespace, label, field, resourceVersion), nil)
|
||||
return c.Fake.Watch, c.Fake.Err()
|
||||
}
|
||||
|
||||
func (c *FakeEndpoints) Update(endpoints *api.Endpoints) (*api.Endpoints, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-endpoints", Value: endpoints.Name}, &api.Endpoints{})
|
||||
return obj.(*api.Endpoints), err
|
||||
}
|
||||
|
@@ -30,48 +30,72 @@ type FakeEvents struct {
|
||||
Fake *Fake
|
||||
}
|
||||
|
||||
// Create makes a new event. Returns the copy of the event the server returns, or an error.
|
||||
func (c *FakeEvents) Create(event *api.Event) (*api.Event, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "get-event", Value: event.Name}, &api.Event{})
|
||||
return obj.(*api.Event), err
|
||||
}
|
||||
// Get returns the given event, or an error.
|
||||
func (c *FakeEvents) Get(name string) (*api.Event, error) {
|
||||
obj, err := c.Fake.Invokes(NewRootGetAction("events", name), &api.Event{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Update replaces an existing event. Returns the copy of the event the server returns, or an error.
|
||||
func (c *FakeEvents) Update(event *api.Event) (*api.Event, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-event", Value: event.Name}, &api.Event{})
|
||||
return obj.(*api.Event), err
|
||||
}
|
||||
|
||||
// List returns a list of events matching the selectors.
|
||||
func (c *FakeEvents) List(label labels.Selector, field fields.Selector) (*api.EventList, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "list-events"}, &api.EventList{})
|
||||
obj, err := c.Fake.Invokes(NewRootListAction("events", label, field), &api.EventList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.EventList), err
|
||||
}
|
||||
|
||||
// Get returns the given event, or an error.
|
||||
func (c *FakeEvents) Get(id string) (*api.Event, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "get-endpoints", Value: id}, &api.Event{})
|
||||
// Create makes a new event. Returns the copy of the event the server returns, or an error.
|
||||
func (c *FakeEvents) Create(event *api.Event) (*api.Event, error) {
|
||||
obj, err := c.Fake.Invokes(NewRootCreateAction("events", event), event)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Event), err
|
||||
}
|
||||
|
||||
// Update replaces an existing event. Returns the copy of the event the server returns, or an error.
|
||||
func (c *FakeEvents) Update(event *api.Event) (*api.Event, error) {
|
||||
obj, err := c.Fake.Invokes(NewRootUpdateAction("events", event), event)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Event), err
|
||||
}
|
||||
|
||||
func (c *FakeEvents) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(NewRootDeleteAction("events", name), &api.Event{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Watch starts watching for events matching the given selectors.
|
||||
func (c *FakeEvents) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
c.Fake.Invokes(FakeAction{Action: "watch-events", Value: resourceVersion}, nil)
|
||||
c.Fake.Invokes(NewRootWatchAction("events", label, field, resourceVersion), nil)
|
||||
return c.Fake.Watch, c.Fake.Err()
|
||||
}
|
||||
|
||||
// Search returns a list of events matching the specified object.
|
||||
func (c *FakeEvents) Search(objOrRef runtime.Object) (*api.EventList, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "search-events"}, &api.EventList{})
|
||||
obj, err := c.Fake.Invokes(NewRootListAction("events", nil, nil), &api.EventList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.EventList), err
|
||||
}
|
||||
|
||||
func (c *FakeEvents) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(FakeAction{Action: "delete-event", Value: name}, &api.Event{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeEvents) GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector {
|
||||
c.Fake.Invokes(FakeAction{Action: "get-field-selector"}, nil)
|
||||
action := GenericActionImpl{}
|
||||
action.Verb = "get-field-selector"
|
||||
action.Resource = "events"
|
||||
|
||||
c.Fake.Invokes(action, nil)
|
||||
return fields.Everything()
|
||||
}
|
||||
|
@@ -30,32 +30,48 @@ type FakeLimitRanges struct {
|
||||
Namespace string
|
||||
}
|
||||
|
||||
func (c *FakeLimitRanges) List(selector labels.Selector) (*api.LimitRangeList, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "list-limitRanges"}, &api.LimitRangeList{})
|
||||
return obj.(*api.LimitRangeList), err
|
||||
}
|
||||
|
||||
func (c *FakeLimitRanges) Get(name string) (*api.LimitRange, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "get-limitRange", Value: name}, &api.LimitRange{})
|
||||
obj, err := c.Fake.Invokes(NewGetAction("limitranges", c.Namespace, name), &api.LimitRange{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.LimitRange), err
|
||||
}
|
||||
|
||||
func (c *FakeLimitRanges) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(FakeAction{Action: "delete-limitRange", Value: name}, &api.LimitRange{})
|
||||
return err
|
||||
func (c *FakeLimitRanges) List(label labels.Selector) (*api.LimitRangeList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("limitranges", c.Namespace, label, nil), &api.LimitRangeList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.LimitRangeList), err
|
||||
}
|
||||
|
||||
func (c *FakeLimitRanges) Create(limitRange *api.LimitRange) (*api.LimitRange, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "create-limitRange"}, &api.LimitRange{})
|
||||
obj, err := c.Fake.Invokes(NewCreateAction("limitranges", c.Namespace, limitRange), limitRange)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.LimitRange), err
|
||||
}
|
||||
|
||||
func (c *FakeLimitRanges) Update(limitRange *api.LimitRange) (*api.LimitRange, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-limitRange", Value: limitRange.Name}, &api.LimitRange{})
|
||||
obj, err := c.Fake.Invokes(NewUpdateAction("limitranges", c.Namespace, limitRange), limitRange)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.LimitRange), err
|
||||
}
|
||||
|
||||
func (c *FakeLimitRanges) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(NewDeleteAction("limitranges", c.Namespace, name), &api.LimitRange{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeLimitRanges) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
c.Fake.Invokes(FakeAction{Action: "watch-limitRange", Value: resourceVersion}, nil)
|
||||
c.Fake.Invokes(NewWatchAction("limitranges", c.Namespace, label, field, resourceVersion), nil)
|
||||
return c.Fake.Watch, nil
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -30,36 +30,62 @@ type FakeNodes struct {
|
||||
}
|
||||
|
||||
func (c *FakeNodes) Get(name string) (*api.Node, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "get-node", Value: name}, &api.Node{})
|
||||
obj, err := c.Fake.Invokes(NewRootGetAction("nodes", name), &api.Node{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Node), err
|
||||
}
|
||||
|
||||
func (c *FakeNodes) List(label labels.Selector, field fields.Selector) (*api.NodeList, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "list-nodes"}, &api.NodeList{})
|
||||
obj, err := c.Fake.Invokes(NewRootListAction("nodes", label, field), &api.NodeList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.NodeList), err
|
||||
}
|
||||
|
||||
func (c *FakeNodes) Create(minion *api.Node) (*api.Node, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "create-node", Value: minion}, &api.Node{})
|
||||
obj, err := c.Fake.Invokes(NewRootCreateAction("nodes", minion), minion)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Node), err
|
||||
}
|
||||
|
||||
func (c *FakeNodes) Update(minion *api.Node) (*api.Node, error) {
|
||||
obj, err := c.Fake.Invokes(NewRootUpdateAction("nodes", minion), minion)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Node), err
|
||||
}
|
||||
|
||||
func (c *FakeNodes) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(FakeAction{Action: "delete-node", Value: name}, &api.Node{})
|
||||
_, err := c.Fake.Invokes(NewRootDeleteAction("nodes", name), &api.Node{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeNodes) Update(minion *api.Node) (*api.Node, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-node", Value: minion}, &api.Node{})
|
||||
return obj.(*api.Node), err
|
||||
func (c *FakeNodes) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
c.Fake.Invokes(NewRootWatchAction("nodes", label, field, resourceVersion), nil)
|
||||
return c.Fake.Watch, c.Fake.Err()
|
||||
}
|
||||
|
||||
func (c *FakeNodes) UpdateStatus(minion *api.Node) (*api.Node, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-status-node", Value: minion}, &api.Node{})
|
||||
action := CreateActionImpl{}
|
||||
action.Verb = "update"
|
||||
action.Resource = "nodes"
|
||||
action.Subresource = "status"
|
||||
action.Object = minion
|
||||
|
||||
obj, err := c.Fake.Invokes(action, minion)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Node), err
|
||||
}
|
||||
|
||||
func (c *FakeNodes) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
c.Fake.Invokes(FakeAction{Action: "watch-nodes", Value: resourceVersion}, nil)
|
||||
return c.Fake.Watch, c.Fake.Err()
|
||||
}
|
||||
|
@@ -28,37 +28,63 @@ type FakePersistentVolumeClaims struct {
|
||||
Namespace string
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumeClaims) List(label labels.Selector, field fields.Selector) (*api.PersistentVolumeClaimList, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "list-persistentVolumeClaims"}, &api.PersistentVolumeClaimList{})
|
||||
return obj.(*api.PersistentVolumeClaimList), err
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumeClaims) Get(name string) (*api.PersistentVolumeClaim, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "get-persistentVolumeClaims", Value: name}, &api.PersistentVolumeClaim{})
|
||||
obj, err := c.Fake.Invokes(NewGetAction("persistentvolumeclaims", c.Namespace, name), &api.PersistentVolumeClaim{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.PersistentVolumeClaim), err
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumeClaims) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(FakeAction{Action: "delete-persistentVolumeClaims", Value: name}, &api.PersistentVolumeClaim{})
|
||||
return err
|
||||
func (c *FakePersistentVolumeClaims) List(label labels.Selector, field fields.Selector) (*api.PersistentVolumeClaimList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("persistentvolumeclaims", c.Namespace, label, field), &api.PersistentVolumeClaimList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.PersistentVolumeClaimList), err
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumeClaims) Create(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "create-persistentVolumeClaims"}, &api.PersistentVolumeClaim{})
|
||||
obj, err := c.Fake.Invokes(NewCreateAction("persistentvolumeclaims", c.Namespace, claim), claim)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.PersistentVolumeClaim), err
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumeClaims) Update(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-persistentVolumeClaims", Value: claim.Name}, &api.PersistentVolumeClaim{})
|
||||
obj, err := c.Fake.Invokes(NewUpdateAction("persistentvolumeclaims", c.Namespace, claim), claim)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.PersistentVolumeClaim), err
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumeClaims) UpdateStatus(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-status-persistentVolumeClaims", Value: claim}, &api.PersistentVolumeClaim{})
|
||||
return obj.(*api.PersistentVolumeClaim), err
|
||||
func (c *FakePersistentVolumeClaims) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(NewDeleteAction("persistentvolumeclaims", c.Namespace, name), &api.PersistentVolumeClaim{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumeClaims) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
c.Fake.Invokes(FakeAction{Action: "watch-persistentVolumeClaims", Value: resourceVersion}, nil)
|
||||
c.Fake.Invokes(NewWatchAction("persistentvolumeclaims", c.Namespace, label, field, resourceVersion), nil)
|
||||
return c.Fake.Watch, c.Fake.Err()
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumeClaims) UpdateStatus(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) {
|
||||
action := UpdateActionImpl{}
|
||||
action.Verb = "update"
|
||||
action.Resource = "persistentvolumeclaims"
|
||||
action.Subresource = "status"
|
||||
action.Object = claim
|
||||
|
||||
obj, err := c.Fake.Invokes(action, claim)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.PersistentVolumeClaim), err
|
||||
}
|
||||
|
@@ -24,41 +24,66 @@ import (
|
||||
)
|
||||
|
||||
type FakePersistentVolumes struct {
|
||||
Fake *Fake
|
||||
Namespace string
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumes) List(label labels.Selector, field fields.Selector) (*api.PersistentVolumeList, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "list-persistentVolumes"}, &api.PersistentVolumeList{})
|
||||
return obj.(*api.PersistentVolumeList), err
|
||||
Fake *Fake
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumes) Get(name string) (*api.PersistentVolume, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "get-persistentVolumes", Value: name}, &api.PersistentVolume{})
|
||||
obj, err := c.Fake.Invokes(NewRootGetAction("persistentvolumes", name), &api.PersistentVolume{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.PersistentVolume), err
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumes) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(FakeAction{Action: "delete-persistentVolumes", Value: name}, &api.PersistentVolume{})
|
||||
return err
|
||||
func (c *FakePersistentVolumes) List(label labels.Selector, field fields.Selector) (*api.PersistentVolumeList, error) {
|
||||
obj, err := c.Fake.Invokes(NewRootListAction("persistentvolumes", label, field), &api.PersistentVolumeList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.PersistentVolumeList), err
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumes) Create(pv *api.PersistentVolume) (*api.PersistentVolume, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "create-persistentVolumes"}, &api.PersistentVolume{})
|
||||
obj, err := c.Fake.Invokes(NewRootCreateAction("persistentvolumes", pv), pv)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.PersistentVolume), err
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumes) Update(pv *api.PersistentVolume) (*api.PersistentVolume, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-persistentVolumes", Value: pv.Name}, &api.PersistentVolume{})
|
||||
obj, err := c.Fake.Invokes(NewRootUpdateAction("persistentvolumes", pv), pv)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.PersistentVolume), err
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumes) UpdateStatus(pv *api.PersistentVolume) (*api.PersistentVolume, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-status-persistentVolumes", Value: pv}, &api.PersistentVolume{})
|
||||
return obj.(*api.PersistentVolume), err
|
||||
func (c *FakePersistentVolumes) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(NewRootDeleteAction("persistentvolumes", name), &api.PersistentVolume{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumes) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
c.Fake.Invokes(FakeAction{Action: "watch-persistentVolumes", Value: resourceVersion}, nil)
|
||||
c.Fake.Invokes(NewRootWatchAction("persistentvolumes", label, field, resourceVersion), nil)
|
||||
return c.Fake.Watch, c.Fake.Err()
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumes) UpdateStatus(pv *api.PersistentVolume) (*api.PersistentVolume, error) {
|
||||
action := UpdateActionImpl{}
|
||||
action.Verb = "update"
|
||||
action.Resource = "persistentvolumes"
|
||||
action.Subresource = "status"
|
||||
action.Object = pv
|
||||
|
||||
obj, err := c.Fake.Invokes(action, pv)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.PersistentVolume), err
|
||||
}
|
||||
|
@@ -30,32 +30,48 @@ type FakePodTemplates struct {
|
||||
Namespace string
|
||||
}
|
||||
|
||||
func (c *FakePodTemplates) List(label labels.Selector, field fields.Selector) (*api.PodTemplateList, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "list-podTemplates"}, &api.PodTemplateList{})
|
||||
return obj.(*api.PodTemplateList), err
|
||||
}
|
||||
|
||||
func (c *FakePodTemplates) Get(name string) (*api.PodTemplate, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "get-podTemplate", Value: name}, &api.PodTemplate{})
|
||||
obj, err := c.Fake.Invokes(NewGetAction("podtemplates", c.Namespace, name), &api.PodTemplate{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.PodTemplate), err
|
||||
}
|
||||
|
||||
func (c *FakePodTemplates) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.Invokes(FakeAction{Action: "delete-podTemplate", Value: name}, &api.PodTemplate{})
|
||||
return err
|
||||
func (c *FakePodTemplates) List(label labels.Selector, field fields.Selector) (*api.PodTemplateList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("podtemplates", c.Namespace, label, field), &api.PodTemplateList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.PodTemplateList), err
|
||||
}
|
||||
|
||||
func (c *FakePodTemplates) Create(pod *api.PodTemplate) (*api.PodTemplate, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "create-podTemplate"}, &api.PodTemplate{})
|
||||
obj, err := c.Fake.Invokes(NewCreateAction("podtemplates", c.Namespace, pod), pod)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.PodTemplate), err
|
||||
}
|
||||
|
||||
func (c *FakePodTemplates) Update(pod *api.PodTemplate) (*api.PodTemplate, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-podTemplate", Value: pod.Name}, &api.PodTemplate{})
|
||||
obj, err := c.Fake.Invokes(NewUpdateAction("podtemplates", c.Namespace, pod), pod)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.PodTemplate), err
|
||||
}
|
||||
|
||||
func (c *FakePodTemplates) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.Invokes(NewDeleteAction("podtemplates", c.Namespace, name), &api.PodTemplate{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakePodTemplates) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
c.Fake.Invokes(FakeAction{Action: "watch-podTemplates", Value: resourceVersion}, nil)
|
||||
c.Fake.Invokes(NewWatchAction("podtemplates", c.Namespace, label, field, resourceVersion), nil)
|
||||
return c.Fake.Watch, c.Fake.Err()
|
||||
}
|
||||
|
@@ -30,42 +30,74 @@ type FakePods struct {
|
||||
Namespace string
|
||||
}
|
||||
|
||||
func (c *FakePods) List(label labels.Selector, field fields.Selector) (*api.PodList, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "list-pods"}, &api.PodList{})
|
||||
return obj.(*api.PodList), err
|
||||
}
|
||||
|
||||
func (c *FakePods) Get(name string) (*api.Pod, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "get-pod", Value: name}, &api.Pod{})
|
||||
obj, err := c.Fake.Invokes(NewGetAction("pods", c.Namespace, name), &api.Pod{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Pod), err
|
||||
}
|
||||
|
||||
func (c *FakePods) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.Invokes(FakeAction{Action: "delete-pod", Value: name}, &api.Pod{})
|
||||
return err
|
||||
func (c *FakePods) List(label labels.Selector, field fields.Selector) (*api.PodList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("pods", c.Namespace, label, field), &api.PodList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.PodList), err
|
||||
}
|
||||
|
||||
func (c *FakePods) Create(pod *api.Pod) (*api.Pod, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "create-pod"}, &api.Pod{})
|
||||
obj, err := c.Fake.Invokes(NewCreateAction("pods", c.Namespace, pod), pod)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Pod), err
|
||||
}
|
||||
|
||||
func (c *FakePods) Update(pod *api.Pod) (*api.Pod, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-pod", Value: pod.Name}, &api.Pod{})
|
||||
obj, err := c.Fake.Invokes(NewUpdateAction("pods", c.Namespace, pod), pod)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Pod), err
|
||||
}
|
||||
|
||||
func (c *FakePods) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.Invokes(NewDeleteAction("pods", c.Namespace, name), &api.Pod{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakePods) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
c.Fake.Invokes(FakeAction{Action: "watch-pods", Value: resourceVersion}, nil)
|
||||
c.Fake.Invokes(NewWatchAction("pods", c.Namespace, label, field, resourceVersion), nil)
|
||||
return c.Fake.Watch, c.Fake.Err()
|
||||
}
|
||||
|
||||
func (c *FakePods) Bind(bind *api.Binding) error {
|
||||
c.Fake.Invokes(FakeAction{Action: "bind-pod", Value: bind.Name}, nil)
|
||||
return nil
|
||||
func (c *FakePods) Bind(binding *api.Binding) error {
|
||||
action := CreateActionImpl{}
|
||||
action.Verb = "create"
|
||||
action.Resource = "pods"
|
||||
action.Subresource = "bindings"
|
||||
action.Object = binding
|
||||
|
||||
_, err := c.Fake.Invokes(action, binding)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakePods) UpdateStatus(pod *api.Pod) (*api.Pod, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-status-pod", Value: pod.Name}, &api.Pod{})
|
||||
action := UpdateActionImpl{}
|
||||
action.Verb = "update"
|
||||
action.Resource = "pods"
|
||||
action.Subresource = "status"
|
||||
action.Object = pod
|
||||
|
||||
obj, err := c.Fake.Invokes(action, pod)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Pod), err
|
||||
}
|
||||
|
@@ -30,41 +30,48 @@ type FakeReplicationControllers struct {
|
||||
Namespace string
|
||||
}
|
||||
|
||||
const (
|
||||
GetControllerAction = "get-replicationController"
|
||||
UpdateControllerAction = "update-replicationController"
|
||||
WatchControllerAction = "watch-replicationController"
|
||||
DeleteControllerAction = "delete-replicationController"
|
||||
ListControllerAction = "list-replicationController"
|
||||
CreateControllerAction = "create-replicationController"
|
||||
)
|
||||
|
||||
func (c *FakeReplicationControllers) List(selector labels.Selector) (*api.ReplicationControllerList, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: ListControllerAction}, &api.ReplicationControllerList{})
|
||||
return obj.(*api.ReplicationControllerList), err
|
||||
}
|
||||
|
||||
func (c *FakeReplicationControllers) Get(name string) (*api.ReplicationController, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: GetControllerAction, Value: name}, &api.ReplicationController{})
|
||||
obj, err := c.Fake.Invokes(NewGetAction("replicationcontrollers", c.Namespace, name), &api.ReplicationController{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.ReplicationController), err
|
||||
}
|
||||
|
||||
func (c *FakeReplicationControllers) List(label labels.Selector) (*api.ReplicationControllerList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("replicationcontrollers", c.Namespace, label, nil), &api.ReplicationControllerList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.ReplicationControllerList), err
|
||||
}
|
||||
|
||||
func (c *FakeReplicationControllers) Create(controller *api.ReplicationController) (*api.ReplicationController, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: CreateControllerAction, Value: controller}, &api.ReplicationController{})
|
||||
obj, err := c.Fake.Invokes(NewCreateAction("replicationcontrollers", c.Namespace, controller), controller)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.ReplicationController), err
|
||||
}
|
||||
|
||||
func (c *FakeReplicationControllers) Update(controller *api.ReplicationController) (*api.ReplicationController, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: UpdateControllerAction, Value: controller}, &api.ReplicationController{})
|
||||
obj, err := c.Fake.Invokes(NewUpdateAction("replicationcontrollers", c.Namespace, controller), controller)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.ReplicationController), err
|
||||
}
|
||||
|
||||
func (c *FakeReplicationControllers) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(FakeAction{Action: DeleteControllerAction, Value: name}, &api.ReplicationController{})
|
||||
_, err := c.Fake.Invokes(NewDeleteAction("replicationcontrollers", c.Namespace, name), &api.ReplicationController{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeReplicationControllers) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
c.Fake.Invokes(FakeAction{Action: WatchControllerAction, Value: resourceVersion}, nil)
|
||||
c.Fake.Invokes(NewWatchAction("replicationcontrollers", c.Namespace, label, field, resourceVersion), nil)
|
||||
return c.Fake.Watch, nil
|
||||
}
|
||||
|
@@ -30,37 +30,63 @@ type FakeResourceQuotas struct {
|
||||
Namespace string
|
||||
}
|
||||
|
||||
func (c *FakeResourceQuotas) List(selector labels.Selector) (*api.ResourceQuotaList, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "list-resourceQuotas"}, &api.ResourceQuotaList{})
|
||||
return obj.(*api.ResourceQuotaList), err
|
||||
}
|
||||
|
||||
func (c *FakeResourceQuotas) Get(name string) (*api.ResourceQuota, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "get-resourceQuota", Value: name}, &api.ResourceQuota{})
|
||||
obj, err := c.Fake.Invokes(NewGetAction("resourcequotas", c.Namespace, name), &api.ResourceQuota{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.ResourceQuota), err
|
||||
}
|
||||
|
||||
func (c *FakeResourceQuotas) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(FakeAction{Action: "delete-resourceQuota", Value: name}, &api.ResourceQuota{})
|
||||
return err
|
||||
func (c *FakeResourceQuotas) List(label labels.Selector) (*api.ResourceQuotaList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("resourcequotas", c.Namespace, label, nil), &api.ResourceQuotaList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.ResourceQuotaList), err
|
||||
}
|
||||
|
||||
func (c *FakeResourceQuotas) Create(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "create-resourceQuota", Value: resourceQuota}, &api.ResourceQuota{})
|
||||
obj, err := c.Fake.Invokes(NewCreateAction("resourcequotas", c.Namespace, resourceQuota), resourceQuota)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.ResourceQuota), err
|
||||
}
|
||||
|
||||
func (c *FakeResourceQuotas) Update(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-resourceQuota", Value: resourceQuota}, &api.ResourceQuota{})
|
||||
obj, err := c.Fake.Invokes(NewUpdateAction("resourcequotas", c.Namespace, resourceQuota), resourceQuota)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.ResourceQuota), err
|
||||
}
|
||||
|
||||
func (c *FakeResourceQuotas) UpdateStatus(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-status-resourceQuota", Value: resourceQuota}, &api.ResourceQuota{})
|
||||
return obj.(*api.ResourceQuota), err
|
||||
func (c *FakeResourceQuotas) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(NewDeleteAction("resourcequotas", c.Namespace, name), &api.ResourceQuota{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeResourceQuotas) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
c.Fake.Invokes(FakeAction{Action: "watch-resourceQuota", Value: resourceVersion}, nil)
|
||||
c.Fake.Invokes(NewWatchAction("resourcequotas", c.Namespace, label, field, resourceVersion), nil)
|
||||
return c.Fake.Watch, nil
|
||||
}
|
||||
|
||||
func (c *FakeResourceQuotas) UpdateStatus(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error) {
|
||||
action := UpdateActionImpl{}
|
||||
action.Verb = "update"
|
||||
action.Resource = "resourcequotas"
|
||||
action.Subresource = "status"
|
||||
action.Object = resourceQuota
|
||||
|
||||
obj, err := c.Fake.Invokes(action, resourceQuota)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.ResourceQuota), err
|
||||
}
|
||||
|
@@ -30,32 +30,48 @@ type FakeSecrets struct {
|
||||
Namespace string
|
||||
}
|
||||
|
||||
func (c *FakeSecrets) List(labels labels.Selector, field fields.Selector) (*api.SecretList, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "list-secrets"}, &api.SecretList{})
|
||||
return obj.(*api.SecretList), err
|
||||
}
|
||||
|
||||
func (c *FakeSecrets) Get(name string) (*api.Secret, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "get-secret", Value: name}, &api.Secret{})
|
||||
obj, err := c.Fake.Invokes(NewGetAction("secrets", c.Namespace, name), &api.Secret{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Secret), err
|
||||
}
|
||||
|
||||
func (c *FakeSecrets) List(label labels.Selector, field fields.Selector) (*api.SecretList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("secrets", c.Namespace, label, field), &api.SecretList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.SecretList), err
|
||||
}
|
||||
|
||||
func (c *FakeSecrets) Create(secret *api.Secret) (*api.Secret, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "create-secret", Value: secret}, &api.Secret{})
|
||||
obj, err := c.Fake.Invokes(NewCreateAction("secrets", c.Namespace, secret), secret)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Secret), err
|
||||
}
|
||||
|
||||
func (c *FakeSecrets) Update(secret *api.Secret) (*api.Secret, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-secret", Value: secret}, &api.Secret{})
|
||||
obj, err := c.Fake.Invokes(NewUpdateAction("secrets", c.Namespace, secret), secret)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Secret), err
|
||||
}
|
||||
|
||||
func (c *FakeSecrets) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(FakeAction{Action: "delete-secret", Value: name}, &api.Secret{})
|
||||
_, err := c.Fake.Invokes(NewDeleteAction("secrets", c.Namespace, name), &api.Secret{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeSecrets) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
c.Fake.Invokes(FakeAction{Action: "watch-secrets", Value: resourceVersion}, nil)
|
||||
c.Fake.Invokes(NewWatchAction("secrets", c.Namespace, label, field, resourceVersion), nil)
|
||||
return c.Fake.Watch, c.Fake.Err()
|
||||
}
|
||||
|
@@ -30,32 +30,48 @@ type FakeServiceAccounts struct {
|
||||
Namespace string
|
||||
}
|
||||
|
||||
func (c *FakeServiceAccounts) List(labels labels.Selector, field fields.Selector) (*api.ServiceAccountList, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "list-serviceaccounts"}, &api.ServiceAccountList{})
|
||||
return obj.(*api.ServiceAccountList), err
|
||||
}
|
||||
|
||||
func (c *FakeServiceAccounts) Get(name string) (*api.ServiceAccount, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "get-serviceaccount", Value: name}, &api.ServiceAccount{})
|
||||
obj, err := c.Fake.Invokes(NewGetAction("serviceaccounts", c.Namespace, name), &api.ServiceAccount{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.ServiceAccount), err
|
||||
}
|
||||
|
||||
func (c *FakeServiceAccounts) List(label labels.Selector, field fields.Selector) (*api.ServiceAccountList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("serviceaccounts", c.Namespace, label, field), &api.ServiceAccountList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.ServiceAccountList), err
|
||||
}
|
||||
|
||||
func (c *FakeServiceAccounts) Create(serviceAccount *api.ServiceAccount) (*api.ServiceAccount, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "create-serviceaccount", Value: serviceAccount}, &api.ServiceAccount{})
|
||||
obj, err := c.Fake.Invokes(NewCreateAction("serviceaccounts", c.Namespace, serviceAccount), serviceAccount)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.ServiceAccount), err
|
||||
}
|
||||
|
||||
func (c *FakeServiceAccounts) Update(serviceAccount *api.ServiceAccount) (*api.ServiceAccount, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-serviceaccount", Value: serviceAccount}, &api.ServiceAccount{})
|
||||
obj, err := c.Fake.Invokes(NewUpdateAction("serviceaccounts", c.Namespace, serviceAccount), serviceAccount)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.ServiceAccount), err
|
||||
}
|
||||
|
||||
func (c *FakeServiceAccounts) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(FakeAction{Action: "delete-serviceaccount", Value: name}, &api.ServiceAccount{})
|
||||
_, err := c.Fake.Invokes(NewDeleteAction("serviceaccounts", c.Namespace, name), &api.ServiceAccount{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeServiceAccounts) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
c.Fake.Invokes(FakeAction{Action: "watch-serviceAccounts", Value: resourceVersion}, nil)
|
||||
c.Fake.Invokes(NewWatchAction("serviceaccounts", c.Namespace, label, field, resourceVersion), nil)
|
||||
return c.Fake.Watch, c.Fake.Err()
|
||||
}
|
||||
|
@@ -30,32 +30,48 @@ type FakeServices struct {
|
||||
Namespace string
|
||||
}
|
||||
|
||||
func (c *FakeServices) List(selector labels.Selector) (*api.ServiceList, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "list-services"}, &api.ServiceList{})
|
||||
return obj.(*api.ServiceList), err
|
||||
}
|
||||
|
||||
func (c *FakeServices) Get(name string) (*api.Service, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "get-service", Value: name}, &api.Service{})
|
||||
obj, err := c.Fake.Invokes(NewGetAction("services", c.Namespace, name), &api.Service{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Service), err
|
||||
}
|
||||
|
||||
func (c *FakeServices) List(label labels.Selector) (*api.ServiceList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("services", c.Namespace, label, nil), &api.ServiceList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.ServiceList), err
|
||||
}
|
||||
|
||||
func (c *FakeServices) Create(service *api.Service) (*api.Service, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "create-service", Value: service}, &api.Service{})
|
||||
obj, err := c.Fake.Invokes(NewCreateAction("services", c.Namespace, service), service)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Service), err
|
||||
}
|
||||
|
||||
func (c *FakeServices) Update(service *api.Service) (*api.Service, error) {
|
||||
obj, err := c.Fake.Invokes(FakeAction{Action: "update-service", Value: service}, &api.Service{})
|
||||
obj, err := c.Fake.Invokes(NewUpdateAction("services", c.Namespace, service), service)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Service), err
|
||||
}
|
||||
|
||||
func (c *FakeServices) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(FakeAction{Action: "delete-service", Value: name}, &api.Service{})
|
||||
_, err := c.Fake.Invokes(NewDeleteAction("services", c.Namespace, name), &api.Service{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeServices) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
c.Fake.Invokes(FakeAction{Action: "watch-services", Value: resourceVersion}, nil)
|
||||
return c.Fake.Watch, c.Fake.Err()
|
||||
c.Fake.Invokes(NewWatchAction("services", c.Namespace, label, field, resourceVersion), nil)
|
||||
return c.Fake.Watch, nil
|
||||
}
|
||||
|
@@ -47,34 +47,36 @@ type ObjectRetriever interface {
|
||||
// ObjectRetriever interface to satisfy retrieval of lists or retrieval of single items.
|
||||
// TODO: add support for sub resources
|
||||
func ObjectReaction(o ObjectRetriever, mapper meta.RESTMapper) ReactionFunc {
|
||||
return func(action FakeAction) (runtime.Object, error) {
|
||||
segments := strings.Split(action.Action, "-")
|
||||
var verb, resource string
|
||||
switch len(segments) {
|
||||
case 3:
|
||||
verb, _, resource = segments[0], segments[1], segments[2]
|
||||
case 2:
|
||||
verb, resource = segments[0], segments[1]
|
||||
default:
|
||||
return nil, fmt.Errorf("unrecognized action, need two or three segments <verb>-<resource> or <verb>-<subresource>-<resource>: %s", action.Action)
|
||||
}
|
||||
_, kind, err := mapper.VersionAndKindForResource(resource)
|
||||
return func(action Action) (runtime.Object, error) {
|
||||
_, kind, err := mapper.VersionAndKindForResource(action.GetResource())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unrecognized action %s: %v", resource, err)
|
||||
return nil, fmt.Errorf("unrecognized action %s: %v", action.GetResource(), err)
|
||||
}
|
||||
|
||||
// TODO: have mapper return a Kind for a subresource?
|
||||
switch verb {
|
||||
case "list", "search":
|
||||
switch castAction := action.(type) {
|
||||
case ListAction:
|
||||
return o.Kind(kind+"List", "")
|
||||
case "get", "create", "update", "delete":
|
||||
// TODO: handle sub resources
|
||||
if s, ok := action.Value.(string); ok && action.Value != nil {
|
||||
return o.Kind(kind, s)
|
||||
case GetAction:
|
||||
return o.Kind(kind, castAction.GetName())
|
||||
case DeleteAction:
|
||||
return o.Kind(kind, castAction.GetName())
|
||||
case CreateAction:
|
||||
meta, err := api.ObjectMetaFor(castAction.GetObject())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return o.Kind(kind, "unknown")
|
||||
return o.Kind(kind, meta.Name)
|
||||
case UpdateAction:
|
||||
meta, err := api.ObjectMetaFor(castAction.GetObject())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return o.Kind(kind, meta.Name)
|
||||
default:
|
||||
return nil, fmt.Errorf("no reaction implemented for %s", action.Action)
|
||||
return nil, fmt.Errorf("no reaction implemented for %s", action)
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
|
@@ -39,19 +39,14 @@ func NewSimpleFake(objects ...runtime.Object) *Fake {
|
||||
return &Fake{ReactFn: ObjectReaction(o, latest.RESTMapper)}
|
||||
}
|
||||
|
||||
type FakeAction struct {
|
||||
Action string
|
||||
Value interface{}
|
||||
}
|
||||
|
||||
// ReactionFunc is a function that returns an object or error for a given Action
|
||||
type ReactionFunc func(FakeAction) (runtime.Object, error)
|
||||
type ReactionFunc func(Action) (runtime.Object, error)
|
||||
|
||||
// Fake implements client.Interface. Meant to be embedded into a struct to get a default
|
||||
// implementation. This makes faking out just the method you want to test easier.
|
||||
type Fake struct {
|
||||
sync.RWMutex
|
||||
actions []FakeAction
|
||||
actions []Action // these may be castable to other types, but "Action" is the minimum
|
||||
err error
|
||||
|
||||
Watch watch.Interface
|
||||
@@ -61,9 +56,9 @@ type Fake struct {
|
||||
ReactFn ReactionFunc
|
||||
}
|
||||
|
||||
// Invokes records the provided FakeAction and then invokes the ReactFn (if provided).
|
||||
// obj is expected to be of the same type a normal call would return.
|
||||
func (c *Fake) Invokes(action FakeAction, obj runtime.Object) (runtime.Object, error) {
|
||||
// Invokes records the provided Action and then invokes the ReactFn (if provided).
|
||||
// defaultReturnObj is expected to be of the same type a normal call would return.
|
||||
func (c *Fake) Invokes(action Action, defaultReturnObj runtime.Object) (runtime.Object, error) {
|
||||
c.Lock()
|
||||
defer c.Unlock()
|
||||
|
||||
@@ -71,7 +66,7 @@ func (c *Fake) Invokes(action FakeAction, obj runtime.Object) (runtime.Object, e
|
||||
if c.ReactFn != nil {
|
||||
return c.ReactFn(action)
|
||||
}
|
||||
return obj, c.err
|
||||
return defaultReturnObj, c.err
|
||||
}
|
||||
|
||||
// ClearActions clears the history of actions called on the fake client
|
||||
@@ -79,14 +74,14 @@ func (c *Fake) ClearActions() {
|
||||
c.Lock()
|
||||
c.Unlock()
|
||||
|
||||
c.actions = make([]FakeAction, 0)
|
||||
c.actions = make([]Action, 0)
|
||||
}
|
||||
|
||||
// Actions returns a chronologically ordered slice fake actions called on the fake client
|
||||
func (c *Fake) Actions() []FakeAction {
|
||||
func (c *Fake) Actions() []Action {
|
||||
c.RLock()
|
||||
defer c.RUnlock()
|
||||
fa := make([]FakeAction, len(c.actions))
|
||||
fa := make([]Action, len(c.actions))
|
||||
copy(fa, c.actions)
|
||||
return fa
|
||||
}
|
||||
@@ -164,13 +159,21 @@ func (c *Fake) Namespaces() client.NamespaceInterface {
|
||||
}
|
||||
|
||||
func (c *Fake) ServerVersion() (*version.Info, error) {
|
||||
c.Invokes(FakeAction{Action: "get-version", Value: nil}, nil)
|
||||
action := ActionImpl{}
|
||||
action.Verb = "get"
|
||||
action.Resource = "version"
|
||||
|
||||
c.Invokes(action, nil)
|
||||
versionInfo := version.Get()
|
||||
return &versionInfo, nil
|
||||
}
|
||||
|
||||
func (c *Fake) ServerAPIVersions() (*api.APIVersions, error) {
|
||||
c.Invokes(FakeAction{Action: "get-apiversions", Value: nil}, nil)
|
||||
action := ActionImpl{}
|
||||
action.Verb = "get"
|
||||
action.Resource = "apiversions"
|
||||
|
||||
c.Invokes(action, nil)
|
||||
return &api.APIVersions{Versions: registered.RegisteredVersions}, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user