config generate, os configure: Add support for mixed arch fleets

Resolves: #1914
Change-type: minor
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
This commit is contained in:
Thodoris Greasidis 2020-07-03 18:40:12 +03:00 committed by Balena CI
parent 95f9443c2a
commit 497023965f

View File

@ -132,11 +132,13 @@ export async function getManifest(
} }
export const areDeviceTypesCompatible = ( export const areDeviceTypesCompatible = (
deviceTypeA: BalenaSdk.DeviceType, appDeviceType: BalenaSdk.DeviceType,
deviceTypeB: BalenaSdk.DeviceType, osDeviceType: BalenaSdk.DeviceType,
) => ) =>
deviceTypeA.arch === deviceTypeB.arch && getBalenaSdk().models.os.isArchitectureCompatibleWith(
!!deviceTypeA.isDependent === !!deviceTypeB.isDependent; osDeviceType.arch,
appDeviceType.arch,
) && !!appDeviceType.isDependent === !!osDeviceType.isDependent;
export async function osProgressHandler(step: InitializeEmitter) { export async function osProgressHandler(step: InitializeEmitter) {
step.on('stdout', process.stdout.write.bind(process.stdout)); step.on('stdout', process.stdout.write.bind(process.stdout));