mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-03 04:26:44 +00:00
Remove ignoreImages argument from getRequiredSteps
The argument was unused and hence unnecesary. This is just a bit of cleanup Change-type: patch
This commit is contained in:
parent
835bf9e49b
commit
76d5be64e5
@ -129,7 +129,6 @@ function reportCurrentState(data?: Partial<InstancedAppState>) {
|
|||||||
export async function getRequiredSteps(
|
export async function getRequiredSteps(
|
||||||
currentApps: InstancedAppState,
|
currentApps: InstancedAppState,
|
||||||
targetApps: InstancedAppState,
|
targetApps: InstancedAppState,
|
||||||
ignoreImages: boolean = false,
|
|
||||||
): Promise<CompositionStep[]> {
|
): Promise<CompositionStep[]> {
|
||||||
// get some required data
|
// get some required data
|
||||||
const [downloading, availableImages] = await Promise.all([
|
const [downloading, availableImages] = await Promise.all([
|
||||||
@ -139,7 +138,6 @@ export async function getRequiredSteps(
|
|||||||
const containerIdsByAppId = getAppContainerIds(currentApps);
|
const containerIdsByAppId = getAppContainerIds(currentApps);
|
||||||
|
|
||||||
return await inferNextSteps(currentApps, targetApps, {
|
return await inferNextSteps(currentApps, targetApps, {
|
||||||
ignoreImages,
|
|
||||||
downloading,
|
downloading,
|
||||||
availableImages,
|
availableImages,
|
||||||
containerIdsByAppId,
|
containerIdsByAppId,
|
||||||
@ -151,7 +149,6 @@ export async function inferNextSteps(
|
|||||||
currentApps: InstancedAppState,
|
currentApps: InstancedAppState,
|
||||||
targetApps: InstancedAppState,
|
targetApps: InstancedAppState,
|
||||||
{
|
{
|
||||||
ignoreImages = false,
|
|
||||||
downloading = [] as string[],
|
downloading = [] as string[],
|
||||||
availableImages = [] as Image[],
|
availableImages = [] as Image[],
|
||||||
containerIdsByAppId = {} as { [appId: number]: Dictionary<string> },
|
containerIdsByAppId = {} as { [appId: number]: Dictionary<string> },
|
||||||
@ -163,10 +160,6 @@ export async function inferNextSteps(
|
|||||||
imageManager.isCleanupNeeded(),
|
imageManager.isCleanupNeeded(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (localMode) {
|
|
||||||
ignoreImages = localMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
const currentAppIds = Object.keys(currentApps).map((i) => parseInt(i, 10));
|
const currentAppIds = Object.keys(currentApps).map((i) => parseInt(i, 10));
|
||||||
const targetAppIds = Object.keys(targetApps).map((i) => parseInt(i, 10));
|
const targetAppIds = Object.keys(targetApps).map((i) => parseInt(i, 10));
|
||||||
|
|
||||||
@ -263,7 +256,7 @@ export async function inferNextSteps(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const newDownloads = steps.filter((s) => s.action === 'fetch').length;
|
const newDownloads = steps.filter((s) => s.action === 'fetch').length;
|
||||||
if (!ignoreImages && delta && newDownloads > 0) {
|
if (!localMode && delta && newDownloads > 0) {
|
||||||
// Check that this is not the first pull for an
|
// Check that this is not the first pull for an
|
||||||
// application, as we want to download all images then
|
// application, as we want to download all images then
|
||||||
// Otherwise we want to limit the downloading of
|
// Otherwise we want to limit the downloading of
|
||||||
@ -290,7 +283,7 @@ export async function inferNextSteps(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ignoreImages && steps.length === 0 && downloading.length > 0) {
|
if (!localMode && steps.length === 0 && downloading.length > 0) {
|
||||||
// We want to keep the state application alive
|
// We want to keep the state application alive
|
||||||
steps.push(generateStep('noop', {}));
|
steps.push(generateStep('noop', {}));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user