Documentation ¶
Index ¶
- func CreateZoneID(region, zone string) string
- func GetZones(nodeHandler *ImprovedFakeNodeHandler) []string
- func NewNode(name string) *v1.Node
- func NewPod(name, host string) *v1.Pod
- type ClientWrapper
- func (m *ClientWrapper) Actions() []clienttesting.Action
- func (m *ClientWrapper) ClearActions()
- func (m *ClientWrapper) Create(ctx context.Context, obj ctlclient.Object, opts ...ctlclient.CreateOption) error
- func (m *ClientWrapper) Delete(ctx context.Context, obj ctlclient.Object, opts ...ctlclient.DeleteOption) error
- func (m *ClientWrapper) DeleteAllOf(ctx context.Context, obj ctlclient.Object, opts ...ctlclient.DeleteAllOfOption) error
- func (m *ClientWrapper) Get(ctx context.Context, key ctlclient.ObjectKey, obj ctlclient.Object, ...) error
- func (m *ClientWrapper) GroupVersionKindFor(obj runtime.Object) (schema.GroupVersionKind, error)
- func (m *ClientWrapper) IsObjectNamespaced(obj runtime.Object) (bool, error)
- func (m *ClientWrapper) List(ctx context.Context, list ctlclient.ObjectList, opts ...ctlclient.ListOption) error
- func (m *ClientWrapper) Patch(ctx context.Context, obj ctlclient.Object, patch ctlclient.Patch, ...) error
- func (m *ClientWrapper) RESTMapper() meta.RESTMapper
- func (m *ClientWrapper) Scheme() *runtime.Scheme
- func (m *ClientWrapper) Status() ctlclient.StatusWriter
- func (m *ClientWrapper) SubResource(subResource string) ctlclient.SubResourceClient
- func (m *ClientWrapper) Update(ctx context.Context, obj ctlclient.Object, opts ...ctlclient.UpdateOption) error
- type FakeLegacyHandler
- type FakeNodeHandler
- func (m *FakeNodeHandler) Apply(ctx context.Context, node *v1apply.NodeApplyConfiguration, ...) (*v1.Node, error)
- func (m *FakeNodeHandler) ApplyStatus(ctx context.Context, node *v1apply.NodeApplyConfiguration, ...) (*v1.Node, error)
- func (m *FakeNodeHandler) Create(ctx context.Context, node *v1.Node, _ metav1.CreateOptions) (*v1.Node, error)
- func (m *FakeNodeHandler) Delete(ctx context.Context, id string, opt metav1.DeleteOptions) error
- func (m *FakeNodeHandler) DeleteCollection(_ context.Context, opt metav1.DeleteOptions, listOpts metav1.ListOptions) error
- func (m *FakeNodeHandler) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Node, error)
- func (m *FakeNodeHandler) GetUpdatedNodeStatusesCopy() []*v1.NodeStatus
- func (m *FakeNodeHandler) GetUpdatedNodesCopy() []*v1.Node
- func (m *FakeNodeHandler) List(ctx context.Context, opts metav1.ListOptions) (*v1.NodeList, error)
- func (m *FakeNodeHandler) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, ...) (*v1.Node, error)
- func (m *FakeNodeHandler) PatchStatus(ctx context.Context, nodeName string, data []byte) (*v1.Node, error)
- func (m *FakeNodeHandler) Update(ctx context.Context, node *v1.Node, _ metav1.UpdateOptions) (*v1.Node, error)
- func (m *FakeNodeHandler) UpdateStatus(ctx context.Context, node *v1.Node, _ metav1.UpdateOptions) (*v1.Node, error)
- func (m *FakeNodeHandler) Watch(_ context.Context, opts metav1.ListOptions) (watch.Interface, error)
- type FakeRecorder
- type ImprovedFakeNodeHandler
- func (m *ImprovedFakeNodeHandler) Core() v1core.CoreV1Interface
- func (m *ImprovedFakeNodeHandler) CoreV1() v1core.CoreV1Interface
- func (m *ImprovedFakeNodeHandler) SyncNode(node *v1.Node, syncStatus bool)
- func (m *ImprovedFakeNodeHandler) UpdateLease(lease *coordv1.Lease) error
- func (m *ImprovedFakeNodeHandler) UpdateNodeStatuses(updatedNodeStatuses map[string]v1.NodeStatus) error
- func (m *ImprovedFakeNodeHandler) UpdateNodes(updatedNodes []*v1.Node) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateZoneID ¶
CreateZoneID returns a single zoneID for a given region and zone.
func GetZones ¶
func GetZones(nodeHandler *ImprovedFakeNodeHandler) []string
GetZones returns list of zones for all Nodes stored in FakeNodeHandler
Types ¶
type ClientWrapper ¶
type ClientWrapper struct { sync.RWMutex RequestCount int PodUpdateReactor func() error NodeUpdateReactor func(node *v1.Node, syncStatus bool) // contains filtered or unexported fields }
func NewClientWrapper ¶
func NewClientWrapper(client ctlclient.Client, scheme *runtime.Scheme) *ClientWrapper
func (*ClientWrapper) Actions ¶
func (m *ClientWrapper) Actions() []clienttesting.Action
func (*ClientWrapper) ClearActions ¶
func (m *ClientWrapper) ClearActions()
func (*ClientWrapper) Create ¶
func (m *ClientWrapper) Create(ctx context.Context, obj ctlclient.Object, opts ...ctlclient.CreateOption) error
func (*ClientWrapper) Delete ¶
func (m *ClientWrapper) Delete(ctx context.Context, obj ctlclient.Object, opts ...ctlclient.DeleteOption) error
Delete deletes the given obj from Kubernetes cluster.
func (*ClientWrapper) DeleteAllOf ¶
func (m *ClientWrapper) DeleteAllOf(ctx context.Context, obj ctlclient.Object, opts ...ctlclient.DeleteAllOfOption) error
func (*ClientWrapper) Get ¶
func (m *ClientWrapper) Get(ctx context.Context, key ctlclient.ObjectKey, obj ctlclient.Object, opts ...ctlclient.GetOption) error
func (m *ClientWrapper) Get(ctx context.Context, key ctlclient.ObjectKey, obj ctlclient.Object) error {
func (*ClientWrapper) GroupVersionKindFor ¶ added in v1.5.0
func (m *ClientWrapper) GroupVersionKindFor(obj runtime.Object) (schema.GroupVersionKind, error)
func (*ClientWrapper) IsObjectNamespaced ¶ added in v1.5.0
func (m *ClientWrapper) IsObjectNamespaced(obj runtime.Object) (bool, error)
func (*ClientWrapper) List ¶
func (m *ClientWrapper) List(ctx context.Context, list ctlclient.ObjectList, opts ...ctlclient.ListOption) error
func (*ClientWrapper) Patch ¶
func (m *ClientWrapper) Patch(ctx context.Context, obj ctlclient.Object, patch ctlclient.Patch, opts ...ctlclient.PatchOption) error
Patch patches the given obj in the Kubernetes cluster. obj must be a struct pointer so that obj can be updated with the content returned by the Server.
func (*ClientWrapper) RESTMapper ¶
func (m *ClientWrapper) RESTMapper() meta.RESTMapper
RESTMapper returns the rest this client is using.
func (*ClientWrapper) Scheme ¶
func (m *ClientWrapper) Scheme() *runtime.Scheme
func (*ClientWrapper) Status ¶
func (m *ClientWrapper) Status() ctlclient.StatusWriter
func (*ClientWrapper) SubResource ¶ added in v1.5.0
func (m *ClientWrapper) SubResource(subResource string) ctlclient.SubResourceClient
func (*ClientWrapper) Update ¶
func (m *ClientWrapper) Update(ctx context.Context, obj ctlclient.Object, opts ...ctlclient.UpdateOption) error
type FakeLegacyHandler ¶
type FakeLegacyHandler struct { v1core.CoreV1Interface // contains filtered or unexported fields }
FakeLegacyHandler is a fake implementation of CoreV1Interface.
func (*FakeLegacyHandler) Nodes ¶
func (m *FakeLegacyHandler) Nodes() v1core.NodeInterface
Nodes return fake NodeInterfaces.
type FakeNodeHandler ¶
type FakeNodeHandler struct { RequestCount int DeleteWaitChan chan struct{} PatchWaitChan chan struct{} NodeUpdateReactor func(node *v1.Node, syncStatus bool) // contains filtered or unexported fields }
FakeNodeHandler is a fake implementation of NodesInterface and NodeInterface. It allows test cases to have fine-grained control over mock behaviors. We also need PodsInterface and PodInterface to test list & delete pods, which is implemented in the embedded client.Fake field.
func (*FakeNodeHandler) Apply ¶
func (m *FakeNodeHandler) Apply(ctx context.Context, node *v1apply.NodeApplyConfiguration, opts metav1.ApplyOptions) (*v1.Node, error)
Apply applies a NodeApplyConfiguration to a Node in the fake store.
func (*FakeNodeHandler) ApplyStatus ¶
func (m *FakeNodeHandler) ApplyStatus(ctx context.Context, node *v1apply.NodeApplyConfiguration, opts metav1.ApplyOptions) (*v1.Node, error)
ApplyStatus applies a status of a Node in the fake store.
func (*FakeNodeHandler) Create ¶
func (m *FakeNodeHandler) Create(ctx context.Context, node *v1.Node, _ metav1.CreateOptions) (*v1.Node, error)
Create adds a new Node to the fake store.
func (*FakeNodeHandler) Delete ¶
func (m *FakeNodeHandler) Delete(ctx context.Context, id string, opt metav1.DeleteOptions) error
Delete deletes a Node from the fake store.
func (*FakeNodeHandler) DeleteCollection ¶
func (m *FakeNodeHandler) DeleteCollection(_ context.Context, opt metav1.DeleteOptions, listOpts metav1.ListOptions) error
DeleteCollection deletes a collection of Nodes from the fake store.
func (*FakeNodeHandler) Get ¶
func (m *FakeNodeHandler) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Node, error)
Get returns a Node from the fake store.
func (*FakeNodeHandler) GetUpdatedNodeStatusesCopy ¶
func (m *FakeNodeHandler) GetUpdatedNodeStatusesCopy() []*v1.NodeStatus
GetUpdatedNodeStatusesCopy returns a slice of Nodes status with updates applied.
func (*FakeNodeHandler) GetUpdatedNodesCopy ¶
func (m *FakeNodeHandler) GetUpdatedNodesCopy() []*v1.Node
GetUpdatedNodesCopy returns a slice of Nodes with updates applied.
func (*FakeNodeHandler) List ¶
func (m *FakeNodeHandler) List(ctx context.Context, opts metav1.ListOptions) (*v1.NodeList, error)
List returns a list of Nodes from the fake store.
func (*FakeNodeHandler) Patch ¶
func (m *FakeNodeHandler) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, _ metav1.PatchOptions, subresources ...string) (*v1.Node, error)
Patch patches a Node in the fake store.
func (*FakeNodeHandler) PatchStatus ¶
func (m *FakeNodeHandler) PatchStatus(ctx context.Context, nodeName string, data []byte) (*v1.Node, error)
PatchStatus patches a status of a Node in the fake store.
func (*FakeNodeHandler) Update ¶
func (m *FakeNodeHandler) Update(ctx context.Context, node *v1.Node, _ metav1.UpdateOptions) (*v1.Node, error)
Update updates a Node in the fake store.
func (*FakeNodeHandler) UpdateStatus ¶
func (m *FakeNodeHandler) UpdateStatus(ctx context.Context, node *v1.Node, _ metav1.UpdateOptions) (*v1.Node, error)
UpdateStatus updates a status of a Node in the fake store.
func (*FakeNodeHandler) Watch ¶
func (m *FakeNodeHandler) Watch(_ context.Context, opts metav1.ListOptions) (watch.Interface, error)
Watch watches Nodes in a fake store.
type FakeRecorder ¶
type FakeRecorder struct { sync.Mutex Events []*v1.Event // contains filtered or unexported fields }
FakeRecorder is used as a fake during testing.
func NewFakeRecorder ¶
func NewFakeRecorder() *FakeRecorder
NewFakeRecorder returns a pointer to a newly constructed FakeRecorder.
func (*FakeRecorder) AnnotatedEventf ¶
func (f *FakeRecorder) AnnotatedEventf(obj runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{})
AnnotatedEventf emits a fake formatted event to the fake recorder
type ImprovedFakeNodeHandler ¶
type ImprovedFakeNodeHandler struct { sync.Mutex *ClientWrapper DelegateNodeHandler *FakeNodeHandler *fake.Clientset UpdatedNodes []*v1.Node UpdatedNodeStatuses []*v1.Node // contains filtered or unexported fields }
func NewImprovedFakeNodeHandler ¶
func NewImprovedFakeNodeHandler(nodes []*v1.Node, pods *v1.PodList) *ImprovedFakeNodeHandler
func (*ImprovedFakeNodeHandler) Core ¶
func (m *ImprovedFakeNodeHandler) Core() v1core.CoreV1Interface
Core returns fake CoreInterface.
func (*ImprovedFakeNodeHandler) CoreV1 ¶
func (m *ImprovedFakeNodeHandler) CoreV1() v1core.CoreV1Interface
CoreV1 returns fake CoreV1Interface
func (*ImprovedFakeNodeHandler) SyncNode ¶
func (m *ImprovedFakeNodeHandler) SyncNode(node *v1.Node, syncStatus bool)
func (*ImprovedFakeNodeHandler) UpdateLease ¶
func (m *ImprovedFakeNodeHandler) UpdateLease(lease *coordv1.Lease) error
func (*ImprovedFakeNodeHandler) UpdateNodeStatuses ¶
func (m *ImprovedFakeNodeHandler) UpdateNodeStatuses(updatedNodeStatuses map[string]v1.NodeStatus) error
func (*ImprovedFakeNodeHandler) UpdateNodes ¶
func (m *ImprovedFakeNodeHandler) UpdateNodes(updatedNodes []*v1.Node) error