modulerun

package
v1.15.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTaskHandler

func RegisterTaskHandler(svc TaskDependencies) func(t sh_task.Task, logger *log.Logger) task.Task

RegisterTaskHandler creates a factory function for ModuleRun tasks

Types

type Task

type Task struct {
	// contains filtered or unexported fields
}

Task handles module execution

func NewTask

func NewTask(
	shellTask sh_task.Task,
	isOperatorStartup bool,
	moduleManager *module_manager.ModuleManager,
	metricStorage metricsstorage.Storage,
	queueService *taskqueue.Service,
	logger *log.Logger,
) *Task

NewTask creates a new task handler for running modules

func (*Task) CreateAndStartQueuesForModuleHooks

func (s *Task) CreateAndStartQueuesForModuleHooks(moduleName string)

CreateAndStartQueuesForModuleHooks creates queues for registered module hooks. It is safe to run this method multiple times, as it checks for existing queues.

func (*Task) Handle

func (s *Task) Handle(ctx context.Context) (res queue.TaskResult)

Handle starts a module by executing module hooks and installing a Helm chart.

Execution sequence: - Run onStartup hooks. - Queue kubernetes hooks as Synchronization tasks. - Wait until Synchronization tasks are done to fill all snapshots. - Enable kubernetes events. - Enable schedule events. - Run beforeHelm hooks - Run Helm to install or upgrade a module's chart. - Run afterHelm hooks.

ModuleRun is restarted if hook or chart is failed. After first Handle success, no onStartup and kubernetes.Synchronization tasks will run.

type TaskDependencies

type TaskDependencies interface {
	GetModuleManager() *module_manager.ModuleManager
	GetMetricStorage() metricsstorage.Storage
	GetQueueService() *taskqueue.Service
}

TaskDependencies defines the interface for accessing necessary components

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL