balena-os / balena-supervisor

Balena Supervisor: balena's agent on devices.
https://balena.io
Other
148 stars 62 forks source link

Expose device ID in a supervisor API endpoint #276

Open pcarranzav opened 7 years ago

pcarranzav commented 7 years ago

Need to take into account that we can't block loading preloaded apps on this (when device ID will still be not defined).

pcarranzav commented 7 years ago

(This is opened following from #25)

psilos commented 6 years ago

Any updates on this request? What is the current limitation on exposing the Device ID under RESIN_ env var ? Is it not stored as state on the image?

pcarranzav commented 6 years ago

Hey @psilos - the problem is device ID is only generated after the device is provisioned on the resin API, and yet the application can run before that (in the case of preloaded apps), in which case we'd either have to cause an unwanted restart of the app once we provision and device ID is set, or ignore any changes to this variable. In both cases there's potential for things breaking. For what particular reason do you need the device ID? So that maybe we can find a workaround for you while we find a solution - most things can be accomplished using RESIN_DEVICE_UUID.

pcarranzav commented 6 years ago

Current plan is to expose the ID as part of the response of a GET /v2/device supervisor API endpoint, as this solves the problem of preloaded apps not having a device ID and allows the user containers to access it.