Documentation ¶
Index ¶
- Constants
- type BindingContextController
- func (b *BindingContextController) ChangeState(newState string) (GeneratedBindingContexts, error)
- func (b *BindingContextController) FakeCluster() *fake.Cluster
- 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 ¶
This section is empty.
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 // contains filtered or unexported fields }
func NewBindingContextController ¶
func NewBindingContextController(config string, version ...fake.ClusterVersion) *BindingContextController
func (*BindingContextController) ChangeState ¶
func (b *BindingContextController) ChangeState(newState string) (GeneratedBindingContexts, error)
func (*BindingContextController) FakeCluster ¶ added in v1.0.2
func (b *BindingContextController) FakeCluster() *fake.Cluster
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)
Run 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 ¶
type StateController struct { CurrentState map[string]manifest.Manifest // contains filtered or unexported fields }
StateController holds objects state for FakeCluster
func NewStateController ¶
func NewStateController(fc *fake.Cluster, ev kubeeventsmanager.KubeEventsManager) *StateController
NewStateController creates controller to apply state changes
func (*StateController) ChangeState ¶
func (c *StateController) ChangeState(newRawState string) error
ChangeState apply changes to current objects state
func (*StateController) SetInitialState ¶
func (c *StateController) SetInitialState(initialState string) error