How opencord/voltha-openolt-adapter works
Project type and purpose
• This is a Go-based “adapter” microservice that acts as a bridge between the VOLTHA core control plane and an OLT device running the OpenOLT agent.
• There is no UI; it’s purely a backend service packaged as a Docker image, driven via CLI (cmd/openolt-adapter) and configured through files and environment variables.
File structure
• cmd/openolt-adapter: the entry point (main.go), profile.go, release.go, common.go, tests
• internal/pkg: subdivided into
• config: reads CLI flags, environment variables, YAML/JSON files
• core: contains device_handler, event manager, flow manager, group manager, stats manager, state transitions, and OpenOLT client abstractions
• resourcemanager: allocates resources per ONU, maintains mappings
• olterrors: error definitions and handling utilities
• pkg/mocks: mock clients for unit testing each external dependency (VOLTHA core, KV store, OpenOLT agent, etc.)
• Docker and compose files: containerization and Kubernetes/Kind integration
• Vendor, go.mod/go.sum: dependency management
README for additional insights
• Describes the adapter’s purpose: connect VOLTHA core to OpenOLT agent
• Lists Makefile and Docker targets like docker-build, docker-push, test, lint
• Explains how to swap in local copies of voltha-protos and voltha-lib-go
Final recommendations
• Container boundary (Docker) around the service to separate it from external systems
• That resource manager and error handling are visible—they’re crucial extensibility points