···5656- **HSMPool-based Agent Discovery**: API and controllers query HSMPool to find all agent instances for a device type
5757- **Multiple Agent Instances**: Each physical device gets its own agent pod (e.g., `hsm-agent-pico-hsm-0`, `hsm-agent-pico-hsm-1`)
5858- **Multi-Agent Operations**: API operations (list, write, delete) work across all agents when mirroring is enabled
5959-- **Automatic Synchronization**: HSMMirrorReconciler handles conflict detection and resolution between devices
5959+- **Automatic Synchronization**: Multi-device operations handle conflict detection and resolution between devices
60606161**gRPC Communication Architecture:**
6262- Protocol definition in `api/proto/hsm/v1/hsm.proto` with 10 HSM operations
···7070Manager Controllers:
7171├── HSMSecretReconciler - HSM to K8s Secret sync
7272├── HSMPoolReconciler - Aggregates discovery reports from pod annotations
7373-├── HSMPoolAgentReconciler - Deploys agents when pools are ready
7474-├── HSMMirrorReconciler - Multi-device HSM mirroring and conflict resolution
7373+├── HSMPoolAgentReconciler - Deploys agents dynamically when devices are ready
7574└── DiscoveryDaemonSetReconciler - Manages discovery DaemonSet lifecycle
76757776Discovery Controllers:
···137136# Production image (agent has PKCS#11 support)
138137make docker-build IMG=hsm-secrets-operator:latest
139138140140-# Testing image (mock clients only, no CGO dependencies)
141141-make docker-build-testing IMG=hsm-secrets-operator:latest
139139+# Production build only (testing handled via build tags)
142140143141# Deploy to cluster
144142make deploy IMG=hsm-secrets-operator:latest
···3253231. `HSMSecretReconciler` reads from HSM via gRPC agents
3263242. `HSMPoolReconciler` aggregates device discovery reports from pod annotations (race-free)
3273253. `HSMPoolAgentReconciler` deploys agents dynamically when devices are ready
328328-4. `HSMSyncReconciler` handles multi-device HSM synchronization (HSM ↔ HSM only)
326326+4. Multi-device operations provide HSM synchronization capabilities
329327330328**Agent Discovery Architecture:**
331329- **HSMPool as Source of Truth**: API and controllers query HSMPool.Status.AggregatedDevices instead of individual HSMDevice resources
-3
internal/modes/manager/manager.go
···251251 return err
252252 }
253253254254- // HSM mirroring is now handled by the sync package and HSMSyncReconciler
255255- // Device discovery is handled by separate discovery daemon
256256-257254 // Get current operator namespace and name
258255 operatorNamespace := getCurrentNamespace()
259256 operatorName := getOperatorName()