feat: move to hard coded topics and move agent id into config #177
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors how the agent's ID and MQTT topics are managed and used throughout the fleet manager and heartbeater components. The changes remove legacy topic configuration fields, introduce a dedicated
agent_idfield, and update how topics are generated and passed between components. Unit tests are updated to reflect these changes and ensure correct agent ID handling in heartbeat messages.Configuration and Topic Management Updates:
HeartbeatTopic,CapabilitiesTopic,TopicName) from theFleetManagerstruct and added a newAgentIDfield for explicit agent identification. (agent/config/types.go)agent_id, instead of merging configuration and token response values. (agent/configmgr/fleet.go)Heartbeater and Fleet Manager Refactoring:
sendSingleHeartbeatandsendHeartbeatsmethods to accept and use theagentIDparameter, ensuring heartbeats carry the correct agent identity. (agent/configmgr/fleet.go) [1] [2]agentIDthrough all relevant calls, including MQTT connection setup. (agent/configmgr/fleet.go) [1] [2] [3]Token Response Structure Changes:
Topicsfield from thetokenResponsestruct, as topic information is now generated separately from JWT and configuration. (agent/configmgr/fleet.go)Unit Test Updates:
agent_idvalue, and removed references to legacy topic fields and token response topics. (agent/configmgr/fleet_test.go) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19]