Documentation
¶
Index ¶
- Constants
- Variables
- func CreateOnStartupTasks()
- func CreateReloadAllTasks(onStartup bool)
- func Init() error
- func InitHttpServer()
- func ManagersEventsHandler()
- func PrefixMetric(metric string) string
- func Run()
- func RunAddonOperatorMetrics()
- func TasksRunner()
- func UpdateScheduleHooks(storage schedule_hook.ScheduledHooksStorage) schedule_hook.ScheduledHooksStorage
Constants ¶
const DefaultConfigMapName = "addon-operator"
const DefaultGlobalHooksDir = "global-hooks"
const DefaultMetricsPrefix = "addon_operator_"
const DefaultModulesDir = "modules"
const DefaultTasksQueueDumpFilePath = "/tmp/addon-operator-tasks-queue"
const DefaultTmpDir = "/tmp/addon-operator"
const DefaultValuesChecksumsAnnotation = "addon-operator/values-checksums"
Variables ¶
var ( ModulesDir string GlobalHooksDir string TempDir string // TasksQueueDumpFilePath is the name of the file to which the queue will be dumped. TasksQueueDumpFilePath string TasksQueue *task.TasksQueue // ModuleManager is the module manager object, which monitors configuration // and variable changes. ConfigMapName string ValuesChecksumsAnnotation string ModuleManager module_manager.ModuleManager ScheduleManager schedule_manager.ScheduleManager ScheduledHooks schedule_hook.ScheduledHooksStorage KubeEventsManager kube_events_manager.KubeEventsManager KubeEventsHooks kube_event_hook.KubeEventsHooksController MetricsPrefix string MetricsStorage *metrics_storage.MetricStorage // ManagersEventsHandlerStopCh is the channel object for stopping infinite loop of the ManagersEventsHandler. ManagersEventsHandlerStopCh chan struct{} // HelmClient is the object for Helm client. HelmClient helm.HelmClient )
var ( QueueIsEmptyDelay = 3 * time.Second FailedHookDelay = 5 * time.Second FailedModuleDelay = 5 * time.Second )
Defining delays in processing tasks from queue.
Functions ¶
func CreateOnStartupTasks ¶
func CreateOnStartupTasks()
func CreateReloadAllTasks ¶
func CreateReloadAllTasks(onStartup bool)
func Init ¶ added in v1.0.6
func Init() error
Init gets all settings, initialize managers and create a working queue.
Settings: directories for modules, global hooks, host name, dump file, tiller namespace.
Initializing necessary objects: helm/tiller, registry manager, module manager, kube events manager.
Creating an empty queue with jobs.
func InitHttpServer ¶
func InitHttpServer()
func ManagersEventsHandler ¶
func ManagersEventsHandler()
func PrefixMetric ¶
func Run ¶
func Run()
Run runs all managers, event and queue handlers.
The main process is blocked by the 'for-select' in the queue handler.
func RunAddonOperatorMetrics ¶
func RunAddonOperatorMetrics()
func TasksRunner ¶
func TasksRunner()
TasksRunner handle tasks in queue.
Task handler may delay task processing by pushing delay to the queue. TODO пока только один обработчик, всё ок. Но лучше, чтобы очередь позволяла удалять только то, чему ранее был сделан peek. Т.е. кто взял в обработку задание, тот его и удалил из очереди. Сейчас Peek-нуть может одна го-рутина, другая добавит, первая Pop-нет задание — новое задание пропало, второй раз будет обработано одно и тоже.
func UpdateScheduleHooks ¶
func UpdateScheduleHooks(storage schedule_hook.ScheduledHooksStorage) schedule_hook.ScheduledHooksStorage
UpdateScheduleHooks creates the new ScheduledHooks. Calculates the difference between the old and the new schedule, removes what was in the old but is missing in the new schedule.
Types ¶
This section is empty.