-
Notifications
You must be signed in to change notification settings - Fork 53
Description
If I only change the CONTROLLER_ID environment variable (for example, in the adapter service) without updating the FromId field in the USP message construction code (such as in NewUspRecord), will this cause issues for the UI or other services when accessing or managing any USP devices? In other words, will a mismatch between CONTROLLER_ID and the FromId used in USP messages affect the normal operation of the system?
Additionally, I would like to suggest adding a corresponding environment variable to the controller service, so that its endpoint id (FromId) can also be configured via an environment variable for consistency and easier management.
Related code as below:
backend/services/mtp/adapter/internal/config/config.go
controllerId := flag.String("controller_id", lookupEnvOrString("CONTROLLER_ID", "oktopusController"), "usp controller endpoint id")
backend/services/controller/internal/usp/usp_utils/utils.go
func NewUspRecord(p []byte, toId string) usp_record.Record { return usp_record.Record{ Version: VERSION, ToId: toId, FromId: "oktopusController", //should not be static one ... } }
Thanks