mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-24 07:46:41 +00:00
Move legacy renaming to formatting function
Change-type: patch Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
f12f474516
commit
d75c58f09d
@ -216,9 +216,15 @@ export class DeviceConfig {
|
||||
const db = trx != null ? trx : this.db.models.bind(this.db);
|
||||
|
||||
const formatted = await this.formatConfigKeys(target);
|
||||
// check for legacy keys
|
||||
if (formatted['OVERRIDE_LOCK'] != null) {
|
||||
formatted['SUPERVISOR_OVERRIDE_LOCK'] = formatted['OVERRIDE_LOCK'];
|
||||
}
|
||||
|
||||
const confToUpdate = {
|
||||
targetValues: JSON.stringify(formatted),
|
||||
};
|
||||
|
||||
await db('deviceConfig').update(confToUpdate);
|
||||
}
|
||||
|
||||
@ -356,11 +362,6 @@ export class DeviceConfig {
|
||||
const humanReadableConfigChanges: Dictionary<string> = {};
|
||||
let reboot = false;
|
||||
|
||||
// If the legacy lock override is used, place it as the new variable
|
||||
if (checkTruthy(target['OVERRIDE_LOCK'])) {
|
||||
target['SUPERVISOR_OVERRIDE_LOCK'] = target['OVERRIDE_LOCK'];
|
||||
}
|
||||
|
||||
_.each(
|
||||
DeviceConfig.configKeys,
|
||||
({ envVarName, varType, rebootRequired }, key) => {
|
||||
|
Loading…
Reference in New Issue
Block a user