Skip to content

Need to edited environment variable for Controller Endpoint ID #390

@Chenshennan

Description

@Chenshennan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions