Documentation ¶
Index ¶
- func InitAndStart(operator *AddonOperator) error
- func QueueHasModuleRunTask(q *queue.TaskQueue, moduleName string) bool
- type AddonOperator
- func (op *AddonOperator) CreateReloadAllTasks(onStartup bool, logLabels map[string]string, eventDescription string) []sh_task.Task
- func (op *AddonOperator) DefineEventHandlers()
- func (op *AddonOperator) InitAndStartHookQueues()
- func (op *AddonOperator) InitModuleManager() error
- func (op *AddonOperator) PrepopulateMainQueue(tqs *queue.TaskQueueSet)
- func (op *AddonOperator) RunAddonOperatorMetrics()
- func (op *AddonOperator) RunDiscoverModulesState(discoverTask sh_task.Task, logLabels map[string]string) ([]sh_task.Task, error)
- func (op *AddonOperator) SetupDebugServerHandles()
- func (op *AddonOperator) SetupHttpServerHandles()
- func (op *AddonOperator) Start()
- func (op *AddonOperator) StartModuleManagerEventHandler()
- func (op *AddonOperator) Stop()
- func (op *AddonOperator) TaskHandler(t sh_task.Task) queue.TaskResult
- func (op *AddonOperator) WithContext(ctx context.Context) *AddonOperator
- func (op *AddonOperator) WithGlobalHooksDir(dir string)
- func (op *AddonOperator) WithModulesDir(dir string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitAndStart ¶
func InitAndStart(operator *AddonOperator) error
Types ¶
type AddonOperator ¶
type AddonOperator struct { *shell_operator.ShellOperator ModulesDir string GlobalHooksDir string KubeConfigManager kube_config_manager.KubeConfigManager // ModuleManager is the module manager object, which monitors configuration // and variable changes. ModuleManager module_manager.ModuleManager HelmResourcesManager helm_resources_manager.HelmResourcesManager // contains filtered or unexported fields }
AddonOperator extends ShellOperator with modules and global hooks and with a value storage.
func DefaultOperator ¶
func DefaultOperator() *AddonOperator
func NewAddonOperator ¶
func NewAddonOperator() *AddonOperator
func (*AddonOperator) CreateReloadAllTasks ¶
func (op *AddonOperator) CreateReloadAllTasks(onStartup bool, logLabels map[string]string, eventDescription string) []sh_task.Task
CreateReloadAllTasks
func (*AddonOperator) DefineEventHandlers ¶
func (op *AddonOperator) DefineEventHandlers()
func (*AddonOperator) InitAndStartHookQueues ¶
func (op *AddonOperator) InitAndStartHookQueues()
CreateQueues create all queues defined in hooks
func (*AddonOperator) InitModuleManager ¶
func (op *AddonOperator) InitModuleManager() error
InitModuleManager initialize objects for addon-operator. This method should be run after Init().
Addon-operator settings:
- directory with modules - directory with global hooks - dump file path
Objects: - helm client - kube config manager - module manager
Also set handlers for task types and handlers to emit tasks.
func (*AddonOperator) PrepopulateMainQueue ¶
func (op *AddonOperator) PrepopulateMainQueue(tqs *queue.TaskQueueSet)
PrepopulateMainQueue adds tasks to run hooks with OnStartup bindings and tasks to enable kubernetes bindings.
func (*AddonOperator) RunAddonOperatorMetrics ¶
func (op *AddonOperator) RunAddonOperatorMetrics()
func (*AddonOperator) RunDiscoverModulesState ¶
func (*AddonOperator) SetupDebugServerHandles ¶
func (op *AddonOperator) SetupDebugServerHandles()
func (*AddonOperator) SetupHttpServerHandles ¶
func (op *AddonOperator) SetupHttpServerHandles()
func (*AddonOperator) Start ¶
func (op *AddonOperator) Start()
Run runs all managers, event and queue handlers.
The main process is blocked by the 'for-select' in the queue handler.
func (*AddonOperator) StartModuleManagerEventHandler ¶
func (op *AddonOperator) StartModuleManagerEventHandler()
func (*AddonOperator) Stop ¶
func (op *AddonOperator) Stop()
func (*AddonOperator) TaskHandler ¶
func (op *AddonOperator) TaskHandler(t sh_task.Task) queue.TaskResult
TasksRunner handle tasks in queue.
Task handler may delay task processing by pushing delay to the queue. FIXME: For now, only one TaskRunner for a TasksQueue. There should be a lock between Peek and Pop to prevent Popping tasks by other TaskRunner for multiple queues.
func (*AddonOperator) WithContext ¶
func (op *AddonOperator) WithContext(ctx context.Context) *AddonOperator
func (*AddonOperator) WithGlobalHooksDir ¶
func (op *AddonOperator) WithGlobalHooksDir(dir string)
func (*AddonOperator) WithModulesDir ¶
func (op *AddonOperator) WithModulesDir(dir string)