Closed reubenmiller closed 1 year ago
How to test:
Start an alpine docker container (interactively)
docker run --rm -it alpine:3.18
Install thin-edge.io, create and upload the device certificate
wget -O - thin-edge.io/install.sh | sh -s
tedge cert create --device-id $(hostname)
tedge config set c8y.url mytenant.latest.stage.c8y.io
tedge cert upload c8y --user myuser@example.com
Connect the mapper to Cumulocity IoT
tedge connect c8y
echo $?
The exit code (printed on the last line) should be zero
QA has thoroughly checked the feature and here are the results:
Is your feature improvement request related to a problem? Please describe.
Connection the bridge using the
tedge connect <cloud>
command is a container throws an unexpected error when the service manager is not available.Describe the solution you'd like
If the service manager is not available (as determined via the
system.toml
is_available
key), then any service control should be a no-op. A warning can still be displayed to alert the user that the service was not managed, however the exit code should be set to0
(instead of non-zero).Describe alternatives you've considered
Additional context
The service manager abstraction provided by thin-edge.io is already in place to handle the situation when the service manager is not available, however it seems that this logic is not utilized in the
tedge connect <cloud>
command, though it is used in thetedge disconnect <cloud>
.This logic seems to be the culprit.
connect/command.rs#L473
Where as the is_available detection in the disconnect command, handles this not available explicitly (and not the overall error):
connect/command.rs#L444