-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow blank as an override for defaultResource #773
Conversation
Hi! thanks for the contribs! We should take into account that resource field is common to every transport, including HTTP where specifies the path where devices for a given group will send measures. So probably only a "valid PATH" should be allowed here. Have you tried to test the behaviour of HTTP transport in this case? Makes sense for you? |
There is currently not a sanity check for an invalid path. If I set The result is: http://localhost:7896/iot/d?k=4jggokgpepnvsb2uv4s40d59ov&i=motion001 returns a 404 - Not Found, since the Agent isn't listening there, it is listening on So setting the value to blank If there is a need for a sanity check on the path (or some useful debug) it will need to be within each individual IoT Agent code rather than the underlying library. |
@@ -219,7 +219,7 @@ function processEnvironmentVariables() { | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe an entry in CHANGES_NEXT_RELEASE file about the changes done by this PR should be added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed a444160
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
We need to test the change in our CI e2e environment to have additional guarantees regarding backward compatibility. Currently, the environment is busy, we will merge and test as soon as we have a free testing slot on it.
Free slot today! Merging. |
Potential fix/workaround for telefonicaid/iotagent-ul#320
When checking to see if
IOTA_DEFAULT_RESOURCE
is set, deliberately check forundefined
rather than general truthiness, since a zero-length string is alsofalse
This allows docker-compose users to set the default resource to blank''
using anENV
as shown:This means that an MQTT device can be successfully provisioned without setting a dummy resource
When a topic is sent to Mosquitto the default resource of
''
is used.This PR would mean that the
docker-compose
for the MQTT tutorial could be updated to work with the latest Ultralight IoT Agent and the issue FIWARE/tutorials.IoT-over-MQTT#8 can be closed thereafterMy opinion on the existing bug can be found here: telefonicaid/iotagent-ul#320 (comment) - in summary both the Agent and the Tutorial should be updated somehow. I think this is a better reasonable workaround for the existing situation, as forcing users to set a resource unnecessarily seems weird.