mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-21 02:01:35 +00:00
Merge pull request #764 from resin-io/balena-os-changes
Changes to properly support balenaOS
This commit is contained in:
commit
d32561e9de
@ -323,9 +323,13 @@ export function addFeaturesFromLabels(
|
||||
}
|
||||
|
||||
if (checkTruthy(service.config.labels['io.balena.features.balena-socket'])) {
|
||||
service.config.volumes.push('/var/run/balena.sock:/var/run/balena.sock');
|
||||
service.config.volumes.push(`${constants.dockerSocket}:${constants.dockerSocket}`);
|
||||
if (service.config.environment['DOCKER_HOST'] == null) {
|
||||
service.config.environment['DOCKER_HOST'] = 'unix:///var/run/balena.sock';
|
||||
service.config.environment['DOCKER_HOST'] = `unix://${constants.dockerSocket}`;
|
||||
}
|
||||
// We keep balena.sock for backwards compatibility
|
||||
if (constants.dockerSocket != '/var/run/balena.sock') {
|
||||
service.config.volumes.push(`${constants.dockerSocket}:/var/run/balena.sock`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ export default class ConfigJsonConfigBackend {
|
||||
if (osVersion == null) {
|
||||
throw new Error('Failed to detect OS version!');
|
||||
}
|
||||
if (/^Resin OS (1|2)./.test(osVersion)) {
|
||||
if (/^(Resin OS|balenaOS)/.test(osVersion)) {
|
||||
// In Resin OS 1.12, $BOOT_MOUNTPOINT was added and it coincides with config.json's path
|
||||
if (constants.bootMountPointFromEnv != null) {
|
||||
return path.join(constants.bootMountPointFromEnv, 'config.json');
|
||||
|
@ -88,7 +88,7 @@ exports.getIPAddresses = ->
|
||||
# - the docker network for the supervisor API (supervisor0)
|
||||
# - custom docker network bridges (br- + 12 hex characters)
|
||||
_.flatten(_.map(_.omitBy(os.networkInterfaces(), (interfaceFields, interfaceName) ->
|
||||
/^(?:balena|docker|rce|tun)[0-9]+|tun[0-9]+|resin-vpn|lo|resin-dns|supervisor0|br-[0-9a-f]{12}$/.test(interfaceName))
|
||||
/^(?:balena|docker|rce|tun)[0-9]+|tun[0-9]+|resin-vpn|lo|resin-dns|supervisor0|balena-redsocks|resin-redsocks|br-[0-9a-f]{12}$/.test(interfaceName))
|
||||
, (validInterfaces) ->
|
||||
_.map(_.pickBy(validInterfaces, family: 'IPv4'), 'address'))
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user