Documentation ¶
Index ¶
- Constants
- Variables
- type BindingContextController
- func (b *BindingContextController) ChangeState(newState ...string) (GeneratedBindingContexts, error)
- func (b *BindingContextController) ChangeStateAndWaitForBindingContexts(desiredQuantity int, newState string) (GeneratedBindingContexts, error)
- func (b *BindingContextController) RegisterCRD(group, version, kind string, namespaced bool)
- func (b *BindingContextController) Run(initialState string) (GeneratedBindingContexts, error)
- func (b *BindingContextController) RunBindingWithAllSnapshots(binding types.BindingType) (GeneratedBindingContexts, error)
- func (b *BindingContextController) RunSchedule(crontab string) (GeneratedBindingContexts, error)
- func (b *BindingContextController) Stop()
- func (b *BindingContextController) WithHook(h *hook.Hook)
- type ContextCombiner
- func (c *ContextCombiner) AddBindingContext(bindingType types.BindingType, info controller.BindingExecutionInfo)
- func (c *ContextCombiner) Combined() []binding_context.BindingContext
- func (c *ContextCombiner) CombinedAndUpdated(hookCtrl controller.HookController) (GeneratedBindingContexts, error)
- func (c *ContextCombiner) QueueLen() int
- type GeneratedBindingContexts
- type StateController
Constants ¶
const TestQueueName string = "test-queue"
TestQueueName is a name of the queue created by ContextCombiner.
const TestTaskType task.TaskType = "TestTask"
TestTaskType is a type for tasks created by ContextCombiner.
Variables ¶
var FakeCluster *fake.FakeCluster
FakeCluster is global for now. It can be encapsulated in BindingContextController lately.
Functions ¶
This section is empty.
Types ¶
type BindingContextController ¶
type BindingContextController struct { Hook *hook.Hook HookCtrl controller.HookController HookMap map[string]string HookConfig string Controller *StateController KubeEventsManager kubeeventsmanager.KubeEventsManager ScheduleManager schedulemanager.ScheduleManager UpdateTimeout time.Duration }
func NewBindingContextController ¶
func NewBindingContextController(config string) (*BindingContextController, error)
func (*BindingContextController) ChangeState ¶
func (b *BindingContextController) ChangeState(newState ...string) (GeneratedBindingContexts, error)
func (*BindingContextController) ChangeStateAndWaitForBindingContexts ¶
func (b *BindingContextController) ChangeStateAndWaitForBindingContexts(desiredQuantity int, newState string) (GeneratedBindingContexts, error)
func (*BindingContextController) RegisterCRD ¶
func (b *BindingContextController) RegisterCRD(group, version, kind string, namespaced bool)
RegisterCRD registers custom resources for the cluster
func (*BindingContextController) Run ¶
func (b *BindingContextController) Run(initialState string) (GeneratedBindingContexts, error)
BindingContextsGenerator generates binding contexts for hook tests
func (*BindingContextController) RunBindingWithAllSnapshots ¶ added in v1.0.1
func (b *BindingContextController) RunBindingWithAllSnapshots(binding types.BindingType) (GeneratedBindingContexts, error)
func (*BindingContextController) RunSchedule ¶
func (b *BindingContextController) RunSchedule(crontab string) (GeneratedBindingContexts, error)
func (*BindingContextController) Stop ¶
func (b *BindingContextController) Stop()
func (*BindingContextController) WithHook ¶
func (b *BindingContextController) WithHook(h *hook.Hook)
type ContextCombiner ¶ added in v1.0.1
type ContextCombiner struct {
// contains filtered or unexported fields
}
ContextCombiner is used to bring logic behind the CombineBindingContextForHook method into tests. This method requires a ShellOperator instance with at least one queue with tasks.
func NewContextCombiner ¶ added in v1.0.1
func NewContextCombiner() *ContextCombiner
func (*ContextCombiner) AddBindingContext ¶ added in v1.0.1
func (c *ContextCombiner) AddBindingContext(bindingType types.BindingType, info controller.BindingExecutionInfo)
func (*ContextCombiner) Combined ¶ added in v1.0.1
func (c *ContextCombiner) Combined() []binding_context.BindingContext
CombinedContext returns a combined context or a binding context from the first task.
func (*ContextCombiner) CombinedAndUpdated ¶ added in v1.0.1
func (c *ContextCombiner) CombinedAndUpdated(hookCtrl controller.HookController) (GeneratedBindingContexts, error)
func (*ContextCombiner) QueueLen ¶ added in v1.0.1
func (c *ContextCombiner) QueueLen() int
type GeneratedBindingContexts ¶
type GeneratedBindingContexts struct { Rendered string BindingContexts []BindingContext }
func ConvertToGeneratedBindingContexts ¶ added in v1.0.1
func ConvertToGeneratedBindingContexts(bindingContexts []binding_context.BindingContext) (GeneratedBindingContexts, error)
type StateController ¶
StateController holds objects state for FakeCluster
func NewStateController ¶
func NewStateController() *StateController
NewStateController creates controller to apply state changes
func (*StateController) ChangeState ¶
func (c *StateController) ChangeState(newRawState string) (int, error)
ChangeState apply changes to current objects state
func (*StateController) SetInitialState ¶
func (c *StateController) SetInitialState(initialState string) error