client: rework apis so that the mender-client registers add-ons and manage them #58
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.
The purpose of this Pull Request is to improve management of add-ons giving the control to the mender client itself instead of relying on user application.
A new function
mender_client_register_addon
is introduced to register the wanted add-on to the mender client. It will then manage init/activation/deactivation/exit for each add-on.Particularly, the inventory and configure add-ons are now only managed by mender-client. Only the mender-troubleshoot add-on has an optional activation still controlled by the user application (because this mean connecting to the network and keeping the connection opened, so it's better to let control).
This enhancement permits additional user custom add-ons to be created and registered to the mender-client, for example to manage specific artifact types.