All tests passed successfully! ✅
- ✅ Created new schema with auto-increment PK
- ✅ Added UNIQUE constraint on (container_id, network_name)
- ✅ Verified column order and data types
- ✅ Inserted container with 3 network interfaces
- ✅ Each interface stored in separate row
- ✅ All IPs and MACs preserved correctly
- ✅ Attempted duplicate insert (correctly failed)
- ✅ UPDATE via ON CONFLICT works
- ✅ IP and MAC updated on network re-scan
- ✅ DELETE removes all interfaces for removed container
- ✅ Container-specific cleanup preserves other containers
- ✅ Network count verified after cleanup
- ✅ Compiled successfully
- ✅ Schema generation works
- ✅ Docker scan logic updated correctly
- ✅ Built successfully
- ✅ normalizeRow handles new column indices
- ✅ Row keys use container_id + network for uniqueness
- ✅ Full workflow: init → scan → update → cleanup
- ✅ API response format verified
- ✅ Multiple networks displayed as separate rows
Container web123 (nginx-prod) appears as 3 rows:
| ID | Container ID | IP | MAC | Network |
|---|---|---|---|---|
| 1 | web123 | 172.17.0.5 | 02:42:ac:11:00:05 | bridge |
| 2 | web123 | 192.168.50.10 | 02:42:c0:a8:32:0a | frontend |
| 3 | web123 | 10.10.0.20 | 02:42:0a:0a:00:14 | backend |
-
Database Schema (
config/atlas_go/internal/db/setup.go&config/scripts/atlas_db_setup.sh)- Changed PK from TEXT to auto-increment INTEGER
- Added
container_idcolumn - Added UNIQUE constraint on (container_id, network_name)
-
Go Code (
config/atlas_go/internal/scan/docker_scan.go)- Updated INSERT to use
container_idcolumn - Changed ON CONFLICT to handle (container_id, network_name)
- Updated cleanup to use
container_idfield
- Updated INSERT to use
-
React UI (
data/react-ui/src/components/HostsTable.jsx)- Updated
normalizeRowto handle different column indices for docker vs hosts - Changed row key generation to use container_id + network
- Each network interface now displays as separate row
- Updated
-
Documentation
- Created MIGRATION_GUIDE.md with upgrade instructions
- Updated README.md to highlight multi-network support
- Added testing documentation
The changes are production-ready:
- ✅ All code compiles
- ✅ All tests pass
- ✅ UI builds successfully
- ✅ Docker build ready
- ✅ Migration guide provided
- ✅ Backward compatibility noted
Users upgrading from previous versions can:
- Fresh install: Just pull the new image (recommended)
- Manual migration: Follow MIGRATION_GUIDE.md to preserve data
- ✅ No performance degradation expected
- ✅ Queries remain fast (indexed on container_id)
- ✅ UI handles additional rows efficiently
- ℹ️ Storage increases linearly with number of networks per container
- Deploy to production
- Monitor for any edge cases
- Collect user feedback
- Consider future enhancements (e.g., network topology visualization)