diff --git a/src/compose/utils.ts b/src/compose/utils.ts index 31796dd3..c870d363 100644 --- a/src/compose/utils.ts +++ b/src/compose/utils.ts @@ -494,7 +494,5 @@ export function normalizeLabels(labels: { labels, (_v, k) => !(_.startsWith(k, 'io.balena.') || _.startsWith(k, 'io.resin.')), ); - return _.assign({}, otherLabels, legacyLabels, balenaLabels) as { - [key: string]: string; - }; + return _.assign({}, otherLabels, legacyLabels, balenaLabels); } diff --git a/src/config/backend.ts b/src/config/backend.ts index fa1a0b1e..a59577a2 100644 --- a/src/config/backend.ts +++ b/src/config/backend.ts @@ -130,7 +130,13 @@ export class RPiConfigBackend extends DeviceConfigBackend { if (conf[key] == null) { conf[key] = []; } - (conf[key] as string[]).push(value); + const confArr = conf[key]; + if (!_.isArray(confArr)) { + throw new Error( + `Expected '${key}' to have a config array but got ${typeof confArr}`, + ); + } + confArr.push(value); } continue; }