mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-20 17:52:51 +00:00
Merge pull request #1980 from balena-os/host-config-patch-should-ignore-apps-present
Allow host config patch regardless of running applications
This commit is contained in:
commit
39a3deed4b
@ -8,7 +8,7 @@ import * as config from './config';
|
||||
import * as applicationManager from './compose/application-manager';
|
||||
import * as constants from './lib/constants';
|
||||
import * as dbus from './lib/dbus';
|
||||
import { ENOENT, InternalInconsistencyError } from './lib/errors';
|
||||
import { ENOENT } from './lib/errors';
|
||||
import { mkdirp, unlinkAll } from './lib/fs-utils';
|
||||
import { writeToBoot } from './lib/host-utils';
|
||||
import * as updateLock from './lib/update-lock';
|
||||
@ -220,10 +220,9 @@ export function get(): Bluebird<HostConfig> {
|
||||
export async function patch(conf: HostConfig, force: boolean): Promise<void> {
|
||||
const apps = await applicationManager.getCurrentApps();
|
||||
const appIds = Object.keys(apps).map((strId) => parseInt(strId, 10));
|
||||
if (!appIds.length) {
|
||||
throw new InternalInconsistencyError('Could not find an appId');
|
||||
}
|
||||
|
||||
// It's possible for appIds to be an empty array, but patch shouldn't fail
|
||||
// as it's not dependent on there being any running user applications.
|
||||
return updateLock.lock(appIds, { force }, () => {
|
||||
const promises: Array<Promise<void>> = [];
|
||||
if (conf != null && conf.network != null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user