Skip to content

Commit

Permalink
Fix discover reporting for static matchers (#48425)
Browse files Browse the repository at this point in the history
Discovery Service now reports the status of the auto enrollment flows
when the matchers come from a DiscoveryConfig resource.

For static matchers, those in
`teleport.yaml/discovery_service.<cloud>.<matcher>` there's no status to
write to.
  • Loading branch information
marcoandredinis authored Nov 5, 2024
1 parent e81af03 commit 3700c1c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/srv/discovery/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ import (
// - AWS Sync (TAG) status
// - AWS EC2 Auto Discover status
func (s *Server) updateDiscoveryConfigStatus(discoveryConfigName string) {
// Static configurations (ie those in `teleport.yaml/discovery_config.<cloud>.matchers`) do not have a DiscoveryConfig resource.
// Those are discarded because there's no Status to update.
if discoveryConfigName == "" {
return
}

discoveryConfigStatus := discoveryconfig.Status{
State: discoveryconfigv1.DiscoveryConfigState_DISCOVERY_CONFIG_STATE_SYNCING.String(),
LastSyncTime: s.clock.Now(),
Expand Down

0 comments on commit 3700c1c

Please sign in to comment.