Documentation ¶
Index ¶
- func CompareTally(expected map[string]int, actual map[string]int) ([]string, error)
- func TallyCounts(tally map[string]int) hookFunc
- func TallyCountsAndKey(tally map[string]int) hookFunc
- type HookingClient
- func (c *HookingClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
- func (c *HookingClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
- func (c *HookingClient) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error
- func (c *HookingClient) Get(ctx context.Context, key client.ObjectKey, obj client.Object) error
- func (c *HookingClient) List(ctx context.Context, obj client.ObjectList, opts ...client.ListOption) error
- func (c *HookingClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, ...) error
- func (c *HookingClient) RESTMapper() meta.RESTMapper
- func (c *HookingClient) Scheme() *runtime.Scheme
- func (c *HookingClient) Status() client.StatusWriter
- func (c *HookingClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
- func (c *HookingClient) Watch(ctx context.Context, list client.ObjectList, opts ...client.ListOption) (watch.Interface, error)
- func (c *HookingClient) WithPostCreateHook(f hookFunc) *HookingClient
- func (c *HookingClient) WithPostDeleteHook(f hookFunc) *HookingClient
- func (c *HookingClient) WithPostGetHook(f getFunc) *HookingClient
- func (c *HookingClient) WithPostPatchHook(f hookFunc) *HookingClient
- func (c *HookingClient) WithPostUpdateHook(f hookFunc) *HookingClient
- func (c *HookingClient) WithPreCreateHook(f hookFunc) *HookingClient
- func (c *HookingClient) WithPreDeleteHook(f hookFunc) *HookingClient
- func (c *HookingClient) WithPreGetHook(f getFunc) *HookingClient
- func (c *HookingClient) WithPrePatchHook(f hookFunc) *HookingClient
- func (c *HookingClient) WithPreUpdateHook(f hookFunc) *HookingClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareTally ¶
CompareTally will compare the two given tallies and return the differences and an error if they are different.
func TallyCounts ¶
TallyCounts will update tally with the Kubernetes Kinds that pass through this hook.
func TallyCountsAndKey ¶
TallyCountsAndKey will update tally with the Kubernetes Kind, object namespace, and object name (separated by '/') that pass through this hook.
Types ¶
type HookingClient ¶
type HookingClient struct {
// contains filtered or unexported fields
}
func NewHookingClient ¶
func NewHookingClient(c client.WithWatch) *HookingClient
NewHookingClient creates a client which allows hooks to be added before and after the client event. Errors returned in the hooks are returned to the caller directly, to simulate issues such as disconnections or errors. Prehooks that cause errors will cause the underlying wrapped client to not be called.
func (*HookingClient) Create ¶
func (c *HookingClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
func (*HookingClient) Delete ¶
func (c *HookingClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
func (*HookingClient) DeleteAllOf ¶
func (c *HookingClient) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error
See sigs.k8s.io/controller-runtime/pkg/client.Writer.DeleteAllOf
func (*HookingClient) List ¶
func (c *HookingClient) List(ctx context.Context, obj client.ObjectList, opts ...client.ListOption) error
func (*HookingClient) Patch ¶
func (c *HookingClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error
func (*HookingClient) RESTMapper ¶
func (c *HookingClient) RESTMapper() meta.RESTMapper
See sigs.k8s.io/controller-runtime/pkg/client.Client.RESTMapper
func (*HookingClient) Scheme ¶
func (c *HookingClient) Scheme() *runtime.Scheme
func (*HookingClient) Status ¶
func (c *HookingClient) Status() client.StatusWriter
func (*HookingClient) Update ¶
func (c *HookingClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
func (*HookingClient) Watch ¶
func (c *HookingClient) Watch(ctx context.Context, list client.ObjectList, opts ...client.ListOption) (watch.Interface, error)
See sigs.k8s.io/controller-runtime/pkg/client.WithWatch.Watch
func (*HookingClient) WithPostCreateHook ¶
func (c *HookingClient) WithPostCreateHook(f hookFunc) *HookingClient
func (*HookingClient) WithPostDeleteHook ¶
func (c *HookingClient) WithPostDeleteHook(f hookFunc) *HookingClient
func (*HookingClient) WithPostGetHook ¶
func (c *HookingClient) WithPostGetHook(f getFunc) *HookingClient
func (*HookingClient) WithPostPatchHook ¶
func (c *HookingClient) WithPostPatchHook(f hookFunc) *HookingClient
func (*HookingClient) WithPostUpdateHook ¶
func (c *HookingClient) WithPostUpdateHook(f hookFunc) *HookingClient
func (*HookingClient) WithPreCreateHook ¶
func (c *HookingClient) WithPreCreateHook(f hookFunc) *HookingClient
func (*HookingClient) WithPreDeleteHook ¶
func (c *HookingClient) WithPreDeleteHook(f hookFunc) *HookingClient
func (*HookingClient) WithPreGetHook ¶
func (c *HookingClient) WithPreGetHook(f getFunc) *HookingClient
func (*HookingClient) WithPrePatchHook ¶
func (c *HookingClient) WithPrePatchHook(f hookFunc) *HookingClient
func (*HookingClient) WithPreUpdateHook ¶
func (c *HookingClient) WithPreUpdateHook(f hookFunc) *HookingClient