mirror of
https://github.com/gravitational/teleport
synced 2024-10-19 08:43:58 +00:00
Add missing DatabasesReady event to DB proxy (#10152)
* Add missing DatabasesReady * Expect TeleportReadyEvent to be emitted when DB proxy run in tests.
This commit is contained in:
parent
ba317929d4
commit
ed62fa17c6
|
@ -838,6 +838,8 @@ func (i *TeleInstance) StartDatabase(conf *service.Config) (*service.TeleportPro
|
|||
conf.UploadEventsC = i.UploadEventsC
|
||||
conf.Auth.Enabled = false
|
||||
conf.Proxy.Enabled = false
|
||||
conf.Apps.Enabled = false
|
||||
conf.SSH.Enabled = false
|
||||
|
||||
// Create a new Teleport process and add it to the list of nodes that
|
||||
// compose this "cluster".
|
||||
|
@ -852,6 +854,7 @@ func (i *TeleInstance) StartDatabase(conf *service.Config) (*service.TeleportPro
|
|||
expectedEvents := []string{
|
||||
service.DatabasesIdentityEvent,
|
||||
service.DatabasesReady,
|
||||
service.TeleportReadyEvent,
|
||||
}
|
||||
|
||||
// Start the process and block until the expected events have arrived.
|
||||
|
@ -1110,6 +1113,9 @@ func (i *TeleInstance) Start() error {
|
|||
if i.Config.Apps.Enabled {
|
||||
expectedEvents = append(expectedEvents, service.AppsReady)
|
||||
}
|
||||
if i.Config.Databases.Enabled {
|
||||
expectedEvents = append(expectedEvents, service.DatabasesReady)
|
||||
}
|
||||
|
||||
// Start the process and block until the expected events have arrived.
|
||||
receivedEvents, err := startAndWait(i.Process, expectedEvents)
|
||||
|
|
|
@ -765,6 +765,9 @@ func NewTeleport(cfg *Config) (*TeleportProcess, error) {
|
|||
if cfg.Apps.Enabled {
|
||||
eventMapping.In = append(eventMapping.In, AppsReady)
|
||||
}
|
||||
if cfg.Databases.Enabled {
|
||||
eventMapping.In = append(eventMapping.In, DatabasesReady)
|
||||
}
|
||||
if cfg.Metrics.Enabled {
|
||||
eventMapping.In = append(eventMapping.In, MetricsReady)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue