Skip to content

Commit

Permalink
Fix discover reporting for static matchers
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 and github-actions committed Nov 5, 2024
1 parent f332712 commit 61ce196
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 61ce196

Please sign in to comment.