mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-18 02:39:49 +00:00
Merge pull request #433 from resin-io/filter-missing-dockerinfo-devices
Filter our devices that do not expose docker socket
This commit is contained in:
commit
29b2f4afa8
@ -58,6 +58,14 @@ limitations under the License.
|
||||
startMessage: 'Scanning for local resinOS devices..',
|
||||
stopMessage: 'Reporting scan results'
|
||||
});
|
||||
}).filter(function(arg) {
|
||||
var address, docker;
|
||||
address = arg.address;
|
||||
docker = new Docker({
|
||||
host: address,
|
||||
port: 2375
|
||||
});
|
||||
return docker.infoAsync()["return"](true).catchReturn(false);
|
||||
}).tap(function(devices) {
|
||||
if (_.isEmpty(devices)) {
|
||||
throw new Error('Could not find any resinOS devices in the local network');
|
||||
|
@ -72,6 +72,9 @@ module.exports =
|
||||
promise: discover.discoverLocalResinOsDevices(options.timeout)
|
||||
startMessage: 'Scanning for local resinOS devices..'
|
||||
stopMessage: 'Reporting scan results'
|
||||
.filter ({ address }) ->
|
||||
docker = new Docker(host: address, port: 2375)
|
||||
docker.infoAsync().return(true).catchReturn(false)
|
||||
.tap (devices) ->
|
||||
if _.isEmpty(devices)
|
||||
throw new Error('Could not find any resinOS devices in the local network')
|
||||
|
Loading…
Reference in New Issue
Block a user