Skip to content

fix: key detectors by config ID to support multiple resources of same type#21

Merged
bakayolo merged 1 commit intomainfrom
fix/detector-config-id-keying
Apr 17, 2026
Merged

fix: key detectors by config ID to support multiple resources of same type#21
bakayolo merged 1 commit intomainfrom
fix/detector-config-id-keying

Conversation

@bakayolo
Copy link
Copy Markdown
Collaborator

Problem

aurora-postgresql and aurora-mysql both have type: aurora in config/resources.yaml. The detectors map was keyed by resource type, so the second entry overwrote the first — only 4 detectors were initialized instead of 5.

Fix

Key invSources, eolProviders, and detectors maps by config ID (e.g., aurora-mysql) instead of resource type (e.g., aurora). Update the orchestrator's default resource list to use config IDs. Remove the now-unnecessary type verification check in ListResources.

Changes

  • cmd/server/main.go — key maps by resourceCfg.ID instead of resourceCfg.Type
  • pkg/workflow/orchestrator/workflow.go — default fan-out uses config IDs
  • pkg/inventory/wiz/generic.go — remove type check in ListResources (source knows its own type)
  • pkg/inventory/wiz/generic_test.go — remove obsolete test

Result

Before: ✓ Total detectors initialized: 4 (aurora collision)
After: ✓ Total detectors initialized: 5 (aurora-postgresql + aurora-mysql)

@bakayolo bakayolo force-pushed the fix/detector-config-id-keying branch 2 times, most recently from 4119d0a to fe067eb Compare April 17, 2026 20:58
… type

aurora-postgresql and aurora-mysql both have type 'aurora', causing
the second to overwrite the first in the detectors map. Fix by keying
all maps (invSources, eolProviders, detectors) by config ID instead
of resource type.

Before: 4 detectors (aurora collision)
After: 5 detectors (aurora-postgresql + aurora-mysql)
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d98f0-cc82-75bf-b664-e3a63eef6ee9
@bakayolo bakayolo force-pushed the fix/detector-config-id-keying branch from fe067eb to 9cc95e3 Compare April 17, 2026 21:00
@bakayolo bakayolo merged commit 6164f2d into main Apr 17, 2026
7 checks passed
@bakayolo bakayolo deleted the fix/detector-config-id-keying branch April 17, 2026 22:05
Copy link
Copy Markdown

@nandiheath nandiheath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 🤖 Automated review passed — no blockers found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants