From 61ce196d6ad4ae44911b449b2a3c260a44effe2e Mon Sep 17 00:00:00 2001 From: Marco Dinis Date: Wed, 30 Oct 2024 18:10:13 +0000 Subject: [PATCH] Fix discover reporting for static matchers 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..` there's no status to write to. --- lib/srv/discovery/status.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/srv/discovery/status.go b/lib/srv/discovery/status.go index 7fe0b0f39398d..66769b0a88933 100644 --- a/lib/srv/discovery/status.go +++ b/lib/srv/discovery/status.go @@ -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..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(),