Help us shape the future of Go! Take the 2026 Go Developer Survey

watcher

package
v0.0.0-...-101cd26 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package watcher provides constants and utilities for OpenStack Watcher service functionality

Index

Constants

View Source
const (
	// ServiceName - Name to identify watcher service
	ServiceName = "watcher"

	// ServiceType - Type of Watcher keystone service
	ServiceType = "infra-optim"

	// DatabaseName - Name of the database used in CREATE DATABASE statement
	DatabaseName = "watcher"

	// DatabaseUsernamePrefix - used by EnsureMariaDBAccount when a new username
	// is created.
	DatabaseUsernamePrefix = "watcher"

	// DatabaseCRName - name of the CR used to create the Watcher database
	DatabaseCRName = "watcher"

	// DefaultsConfigFileName - File name with default configuration
	DefaultsConfigFileName = "00-default.conf"

	// GlobalCustomConfigFileName - File name with custom configuration defined in Watcher
	GlobalCustomConfigFileName = "01-global-custom.conf"

	// ServiceCustomConfigFileName - File name with custom configuration defined in SubCRs
	ServiceCustomConfigFileName = "02-service-custom.conf"

	// LogVolume is the default logVolume name used to mount logs
	LogVolume = "logs"

	// WatcherPublicPort - public port of watcher containers
	WatcherPublicPort int32 = 9322

	// WatcherInternalPort - internal port of watcher containers
	WatcherInternalPort int32 = 9322

	// WatcherLogPath is the path used by WatcherAPI to stream/store its logs
	WatcherLogPath = "/var/log/watcher/"

	// PrometheusCaCertFolderPath is the path to deploy the Prometheus CaCert if needed
	PrometheusCaCertFolderPath = "/etc/pki/ca-trust/extracted/pem/prometheus/"

	// ACConsumerFinalizer is added to AC secrets that watcher is actively consuming
	ACConsumerFinalizer = "openstack.org/watcher-ac-consumer"
	// TransportConsumerFinalizer is added to transport URL secrets that watcher is actively consuming
	TransportConsumerFinalizer = "openstack.org/watcher-transport-consumer"
)

Variables

This section is empty.

Functions

func DBPurgeCronJob

func DBPurgeCronJob(
	instance *watcherv1beta1.Watcher,
	labels map[string]string,
	annotations map[string]string,
) *batchv1.CronJob

DBPurgeCronJob creates a CronJob for database purging operations

func DbSyncJob

func DbSyncJob(instance *watcherv1beta1.Watcher, labels map[string]string, annotations map[string]string) *batchv1.Job

DbSyncJob func

func GetServiceCustomVolumeMount

func GetServiceCustomVolumeMount() corev1.VolumeMount

GetServiceCustomVolumeMount - the "02-service-custom.conf" SubPath mount, used only by watcher-api/applier/decision-engine (each has its own "generateServiceConfigs" populating this key in their own per-component "config-data" Secret) -- not by db-sync/db-purge, whose shared parent-CR secret never has this key.

func GetVolumeMounts

func GetVolumeMounts(secretNames []string) []corev1.VolumeMount

GetVolumeMounts - VolumeMounts shared by every consumer of the "config-data" Secret (watcher-api/applier/decision-engine, plus db-sync/db-purge): the always-present default+global-custom config.d snippets and the mariadb client config, each mounted directly at its final destination via SubPath. The merge/staging pattern kolla used ("/var/lib/config-data/default", then kolla_start copying each file to its real path) is gone -- each file is mounted directly at its final destination from the same "config-data" Secret. "02-service-custom.conf" is deliberately NOT included here: it only exists in the per-component secrets (watcherapi/applier/decision -engine's own "generateServiceConfigs"), not in db-sync/db-purge's shared parent-CR secret, so it's added by the individual callers that need it instead of unconditionally here (a SubPath mount of a key the Secret doesn't have fails the pod outright, unlike kolla's "optional": true).

func GetVolumes

func GetVolumes(name string, secretNames []string) []corev1.Volume

GetVolumes - service volumes

Types

This section is empty.

Jump to

Keyboard shortcuts

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