Closed albinsuresh closed 10 months ago
@albinsuresh I would agree with your proposed solution in having a single section which controls whether the agent is responsible for the given commands or not (as this is more agent functionality rather than the underlying actor for each command handling).
Though maybe a slight edit with of change the name of the section to agent.command
so it matches up with the /cmd/
that we use in the MQTT topic to trigger the commands:
[agent]
enable.config_update = true
enable.config_snapshot = true
enable.log_upload = true
Update 2023-12-15: The ticket description has been updated with the revised implementation.
The implementation can now be tested used the following procedure:
tedge config
, e.g. tedge config set enable.log_upload
tedge-agent
serviceQA has thoroughly checked the feature and here are the results:
Is your feature request related to a problem? Please describe.
Since the
tedge-configuration-plugin
and thetedge-log-plugin
have been merged into thetedge-agent
, there should be a mechanism to disable their corresponding operations (config_snapshot
,config_update
,log_upload
) should the user want to opt-out of their usage. Previously the user could have just disabled the tedge-log-plugin or tedge-configuration-plugin service, but since it is now one single service (tedge-agent), another mechanism is required to disable the functionality.Describe the solution you'd like
Provide a tedge config setting:
agent.enable.<op_name>
to enable/disable each supported operation individually as follows:The scope is explicitly limited to the functionality previously delivered by the tedge-log-plugin and tedge-configuration-plugin (e.g.
log_upload
,config_update
andconfig_snapshot
).Describe alternatives you've considered
The
enable
settings could also be placed under those operation specific config roots as follows:The only downside with this approach is that the
agent
is not mentioned anywhere in the key and a user may misinterpret it as the whole feature is disabled, whereas we're only disabling the inbuilt ops handling by the agent.But the proposed solution also comes with the downside that the enable/disable settings are isolated from the rest of the feature specific config settings mentioned above. Ideally, those feature specific settings should also be moved under the
agent
root setting, alongside theirenable
keys, without breaking backward compatibility as follows:Additional context