Documentation ¶
Index ¶
- func NewCoreClientSet(objects ...runtime.Object) (*Clientset, *FakeObjectTracker)
- type Actions
- type Clientset
- type FakeEvictions
- type FakeObjectTracker
- func (t *FakeObjectTracker) Add(obj runtime.Object) error
- func (o *FakeObjectTracker) ClearOptions() error
- func (t *FakeObjectTracker) Create(gvr schema.GroupVersionResource, obj runtime.Object, ns string) error
- func (o *FakeObjectTracker) DecrementCounter() error
- func (t *FakeObjectTracker) Delete(gvr schema.GroupVersionResource, ns, name string) error
- func (t *FakeObjectTracker) Get(gvr schema.GroupVersionResource, ns, name string) (runtime.Object, error)
- func (t *FakeObjectTracker) List(gvr schema.GroupVersionResource, gvk schema.GroupVersionKind, ns string) (runtime.Object, error)
- func (o *FakeObjectTracker) RunFakeInvocations() error
- func (o *FakeObjectTracker) SetDelay(delay time.Duration) error
- func (o *FakeObjectTracker) SetError(message string) error
- func (o *FakeObjectTracker) SetFakeResourceActions(resourceActions *ResourceActions, counter int) error
- func (t *FakeObjectTracker) Start() error
- func (t *FakeObjectTracker) Stop()
- func (t *FakeObjectTracker) Update(gvr schema.GroupVersionResource, obj runtime.Object, ns string) error
- func (t *FakeObjectTracker) Watch(gvr schema.GroupVersionResource, name string) (watch.Interface, error)
- type FakeObjectTrackers
- type FakePolicyV1beta1
- type ResourceActions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCoreClientSet ¶
func NewCoreClientSet(objects ...runtime.Object) (*Clientset, *FakeObjectTracker)
NewCoreClientSet returns a clientset that will respond with the provided objects. It's backed by a very simple object tracker that processes creates, updates and deletions as-is, without applying any validations and/or defaults. It shouldn't be considered a replacement for a real clientset and is mostly useful in simple unit tests.
Types ¶
type Clientset ¶
type Clientset struct { *k8sfake.Clientset FakeDiscovery *fakediscovery.FakeDiscovery }
Clientset extends k8sfake.Clientset to override the Policy implementation. This is because the default Policy fake implementation does not propagate the eviction name.
func (*Clientset) Discovery ¶
func (c *Clientset) Discovery() discovery.DiscoveryInterface
Discovery returns the fake discovery implementation.
func (*Clientset) Policy ¶
func (c *Clientset) Policy() policyv1beta1.PolicyV1beta1Interface
Policy retrieves the PolicyV1beta1Client
func (*Clientset) PolicyV1beta1 ¶
func (c *Clientset) PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface
PolicyV1beta1 retrieves the PolicyV1beta1Client
type FakeEvictions ¶
type FakeEvictions struct { *fakepolicyv1beta1.FakePolicyV1beta1 // contains filtered or unexported fields }
FakeEvictions extends fakepolicyv1beta1.FakeEvictions to override the Policy implementation. This is because the default Policy fake implementation does not propagate the eviction name.
func (*FakeEvictions) Evict ¶
func (c *FakeEvictions) Evict(ctx context.Context, eviction *apipolicyv1beta1.Eviction) error
Evict overrides the fakepolicyv1beta1.FakeEvictions to override the Policy implementation. This is because the default Policy fake implementation does not propagate the eviction name.
type FakeObjectTracker ¶
type FakeObjectTracker struct { *watch.FakeWatcher // contains filtered or unexported fields }
FakeObjectTracker implements both k8stesting.ObjectTracker as well as watch.Interface.
func NewMachineClientSet ¶
func NewMachineClientSet(objects ...runtime.Object) (*fakeuntyped.Clientset, *FakeObjectTracker)
NewMachineClientSet returns a clientset that will respond with the provided objects. It's backed by a very simple object tracker that processes creates, updates and deletions as-is, without applying any validations and/or defaults. It shouldn't be considered a replacement for a real clientset and is mostly useful in simple unit tests.
func (*FakeObjectTracker) Add ¶
func (t *FakeObjectTracker) Add(obj runtime.Object) error
Add receives an add event with the object
func (*FakeObjectTracker) ClearOptions ¶
func (o *FakeObjectTracker) ClearOptions() error
ClearOptions clears any faking options that have been sets
func (*FakeObjectTracker) Create ¶
func (t *FakeObjectTracker) Create(gvr schema.GroupVersionResource, obj runtime.Object, ns string) error
Create receives an create event with the object
func (*FakeObjectTracker) DecrementCounter ¶
func (o *FakeObjectTracker) DecrementCounter() error
func (*FakeObjectTracker) Delete ¶
func (t *FakeObjectTracker) Delete(gvr schema.GroupVersionResource, ns, name string) error
Delete receives an delete event with the object
func (*FakeObjectTracker) Get ¶
func (t *FakeObjectTracker) Get(gvr schema.GroupVersionResource, ns, name string) (runtime.Object, error)
Get receives an get event with the object
func (*FakeObjectTracker) List ¶
func (t *FakeObjectTracker) List(gvr schema.GroupVersionResource, gvk schema.GroupVersionKind, ns string) (runtime.Object, error)
List receives an list event with the object
func (*FakeObjectTracker) RunFakeInvocations ¶
func (o *FakeObjectTracker) RunFakeInvocations() error
RunFakeInvocations runs any custom fake configurations/methods before invoking standard ObjectTrackers
func (*FakeObjectTracker) SetDelay ¶
SetDelay sets delay while invoking any interface exposed by standard ObjectTrackers
func (*FakeObjectTracker) SetError ¶
SetError sets up the errorMessage to be returned on further function calls
func (*FakeObjectTracker) SetFakeResourceActions ¶
func (o *FakeObjectTracker) SetFakeResourceActions(resourceActions *ResourceActions, counter int) error
SetFakeResourceActions sets up the errorMessage to be returned on specific calls
func (*FakeObjectTracker) Start ¶
func (t *FakeObjectTracker) Start() error
Start begins tracking of an FakeObjectTracker
func (*FakeObjectTracker) Stop ¶
func (t *FakeObjectTracker) Stop()
Stop terminates tracking of an FakeObjectTracker
func (*FakeObjectTracker) Update ¶
func (t *FakeObjectTracker) Update(gvr schema.GroupVersionResource, obj runtime.Object, ns string) error
Update receives an update event with the object
func (*FakeObjectTracker) Watch ¶
func (t *FakeObjectTracker) Watch(gvr schema.GroupVersionResource, name string) (watch.Interface, error)
Watch receives an watch event with the object
type FakeObjectTrackers ¶
type FakeObjectTrackers struct {
ControlMachine, ControlCore, TargetCore *FakeObjectTracker
}
FakeObjectTrackers is a struct containing all the controller fake object trackers
func NewFakeObjectTrackers ¶
func NewFakeObjectTrackers(controlMachine, controlCore, targetCore *FakeObjectTracker) *FakeObjectTrackers
NewFakeObjectTrackers initialize's fakeObjectTrackers initializes the fake object trackers
func (*FakeObjectTrackers) Start ¶
func (o *FakeObjectTrackers) Start()
Start starts all object trackers as go routines
func (*FakeObjectTrackers) Stop ¶
func (o *FakeObjectTrackers) Stop()
Stop stops all object trackers
type FakePolicyV1beta1 ¶
type FakePolicyV1beta1 struct {
*fakepolicyv1beta1.FakePolicyV1beta1
}
FakePolicyV1beta1 extends fakepolicyv1beta1.FakePolicyV1beta1 to override the Policy implementation. This is because the default Policy fake implementation does not propagate the eviction name.
func (*FakePolicyV1beta1) Evictions ¶
func (c *FakePolicyV1beta1) Evictions(namespace string) policyv1beta1.EvictionInterface
Evictions extends fakepolicyv1beta1.FakeEvictions to override the Policy implementation. This is because the default Policy fake implementation does not propagate the eviction name.
type ResourceActions ¶
ResourceActions contains of Kubernetes/Machine resources whose response can be faked