thin-edge / thin-edge.io

The open edge framework for lightweight IoT devices
https://thin-edge.io
Apache License 2.0
222 stars 55 forks source link

Get the version for the c8y_agent fragment from the mapper itself instead from tedge-cli #1991

Closed toewsar closed 1 year ago

toewsar commented 1 year ago

Is your feature request related to a problem? Please describe. Currently the tedge-mapper-c8y publishes the c8y_agent fragement to c8y. The fragment contains the version of thin-edge.io which is read by tedge --version. That makes the mapper dependent of the tedge-cli tool. In our very memory constrained devices we are not able to install the tedge-cli tool, therefore the version is unknown.

Describe the solution you'd like Use the version of the tedge-mapper-c8y. This might also make more sense, because the specific c8y-functionallity depends more on the version of the tedge-mapper and not of the tedge-cli tool.

Describe alternatives you've considered Make a fallback to the tedge-mapper version if calling tedge --version fails.

Additional context

reubenmiller commented 1 year ago

@toewsar Yes this would definitely be a good thing to change to reduce the dependencies between components. And considering the tedge cli is purely optional in cases where a user is creating their own mosquitto bridge configuration file and certificates.

reubenmiller commented 1 year ago

We've now changed the handling to always use the tedge-mapper version rather trying to check the version of the tedge binary. This removes the dependency between to the tedge package.

gligorisaev commented 1 year ago

QA has thoroughly checked the feature and here are the results:

reubenmiller commented 1 year ago

Merged into main and available using pre-release channel, or in next release 0.12.0