mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-01 18:08:29 +02:00
Extend diagnostic api with worker status info
This commit is contained in:
@@ -30,13 +30,14 @@ type Controller struct {
|
||||
|
||||
stopCh chan struct{}
|
||||
|
||||
curWorkerID uint32 //initialized with 0
|
||||
clusterWorkers map[spec.NamespacedName]uint32
|
||||
clustersMu sync.RWMutex
|
||||
clusters map[spec.NamespacedName]*cluster.Cluster
|
||||
clusterLogs map[spec.NamespacedName]ringlog.RingLogger
|
||||
clusterHistory map[spec.NamespacedName]ringlog.RingLogger // history of the cluster changes
|
||||
teamClusters map[string][]spec.NamespacedName
|
||||
curWorkerID uint32 //initialized with 0
|
||||
curWorkerCluster sync.Map
|
||||
clusterWorkers map[spec.NamespacedName]uint32
|
||||
clustersMu sync.RWMutex
|
||||
clusters map[spec.NamespacedName]*cluster.Cluster
|
||||
clusterLogs map[spec.NamespacedName]ringlog.RingLogger
|
||||
clusterHistory map[spec.NamespacedName]ringlog.RingLogger // history of the cluster changes
|
||||
teamClusters map[string][]spec.NamespacedName
|
||||
|
||||
postgresqlInformer cache.SharedIndexInformer
|
||||
podInformer cache.SharedIndexInformer
|
||||
@@ -53,16 +54,17 @@ func NewController(controllerConfig *spec.ControllerConfig) *Controller {
|
||||
logger := logrus.New()
|
||||
|
||||
c := &Controller{
|
||||
config: *controllerConfig,
|
||||
opConfig: &config.Config{},
|
||||
logger: logger.WithField("pkg", "controller"),
|
||||
clusterWorkers: make(map[spec.NamespacedName]uint32),
|
||||
clusters: make(map[spec.NamespacedName]*cluster.Cluster),
|
||||
clusterLogs: make(map[spec.NamespacedName]ringlog.RingLogger),
|
||||
clusterHistory: make(map[spec.NamespacedName]ringlog.RingLogger),
|
||||
teamClusters: make(map[string][]spec.NamespacedName),
|
||||
stopCh: make(chan struct{}),
|
||||
podCh: make(chan spec.PodEvent),
|
||||
config: *controllerConfig,
|
||||
opConfig: &config.Config{},
|
||||
logger: logger.WithField("pkg", "controller"),
|
||||
curWorkerCluster: sync.Map{},
|
||||
clusterWorkers: make(map[spec.NamespacedName]uint32),
|
||||
clusters: make(map[spec.NamespacedName]*cluster.Cluster),
|
||||
clusterLogs: make(map[spec.NamespacedName]ringlog.RingLogger),
|
||||
clusterHistory: make(map[spec.NamespacedName]ringlog.RingLogger),
|
||||
teamClusters: make(map[string][]spec.NamespacedName),
|
||||
stopCh: make(chan struct{}),
|
||||
podCh: make(chan spec.PodEvent),
|
||||
}
|
||||
logger.Hooks.Add(c)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user