Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ const (
// been set up.
InstanceReady = "InstanceReady"

// DiscoveryReady is generated when the Teleport database proxy service
// DiscoveryReady is generated when the Teleport discovery service
// is ready to start accepting connections.
DiscoveryReady = "DiscoveryReady"

Expand Down Expand Up @@ -1072,7 +1072,7 @@ func NewTeleport(cfg *servicecfg.Config) (*TeleportProcess, error) {
if cfg.Tracing.Enabled {
eventMapping.In = append(eventMapping.In, TracingReady)
}
if cfg.Discovery.Enabled {
if process.shouldInitDiscovery() {
eventMapping.In = append(eventMapping.In, DiscoveryReady)
}

Expand Down Expand Up @@ -1124,6 +1124,9 @@ func NewTeleport(cfg *servicecfg.Config) (*TeleportProcess, error) {
process.initDatabases()
serviceStarted = true
} else {
if process.Config.Databases.Enabled {
process.log.Warn("Database service is enabled with empty configuration, skipping initialization")
}
warnOnErr(process.closeImportedDescriptors(teleport.ComponentDatabase), process.log)
}

Expand All @@ -1145,6 +1148,9 @@ func NewTeleport(cfg *servicecfg.Config) (*TeleportProcess, error) {
process.initDiscovery()
serviceStarted = true
} else {
if process.Config.Discovery.Enabled {
process.log.Warn("Discovery service is enabled with empty configuration, skipping initialization")
}
warnOnErr(process.closeImportedDescriptors(teleport.ComponentDiscovery), process.log)
}

Expand Down