Implement Go routine which serves UpdateControlMap DBus endpoint

Description

Acceptance criteria:

  • Implement a new DBus endpoint:

    • Connection name: io.mender.UpdateManager

    • Object path: /io/mender/UpdateManager

    • Interface: io.mender.Update1

    • Method name: SetUpdateControlMap

    • Parameters:

      • update_control_map (string): JSON data (exact format described in MEN-4546, but assume it has id and priority keys)

    • Returns:

      • refresh_timeout (int): Seconds before the request should be refreshed. This should be UpdateControlMapExpirationTimeSeconds / 2.

  • Endpoint must be served from a new Go routine separate from the main thread. This is to keep responsiveness even during an update.

    • Do not reuse the Auth Go routine, we may split this into a separate binary later, so the code should not be mixed.

  • The id and priority fields together form the primary key for the map. All maps with unique keys are stored, but identical keys overwrite each other. For example:

  • All accesses to read and write the maps must be thread safe (mutex probably).

  • The client facing API should be SetMapValue (or similar name)

  • Unit tests

  • Feature branch: feature-dbus_update_control

Affects versions

None

Environment

None

Checklist

Activity

Show:

Ole Petter OrhagenApril 22, 2021 at 7:03 AM
Edited

Fixed

Details

Assignee

Reporter

Story Points

Priority

Days in progress

10

Sprint

Backlog

yes

Zendesk Support

Checklist

Created March 15, 2021 at 2:06 PM
Updated June 25, 2024 at 11:55 AM
Resolved April 27, 2021 at 8:10 AM