From 9fff9266d4e10a90c2bfebbac3896a76e31213f9 Mon Sep 17 00:00:00 2001 From: Alexis Svinartchouk Date: Mon, 28 Dec 2020 17:08:20 +0100 Subject: [PATCH] Add --additional-space flag to preload Change-type: minor --- doc/cli.markdown | 4 ++++ lib/commands/preload.ts | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/doc/cli.markdown b/doc/cli.markdown index f95561fd..b5d18a8a 100644 --- a/doc/cli.markdown +++ b/doc/cli.markdown @@ -2404,6 +2404,10 @@ disables check for matching architecture in image and application pin the preloaded device to the preloaded release on provision +#### --additional-space ADDITIONAL-SPACE + +expand the image by this amount of bytes instead of automatically estimating the required amount + #### --add-certificate ADD-CERTIFICATE Add the given certificate (in PEM format) to /etc/ssl/certs in the preloading container. diff --git a/lib/commands/preload.ts b/lib/commands/preload.ts index c3880563..7db7c511 100644 --- a/lib/commands/preload.ts +++ b/lib/commands/preload.ts @@ -45,6 +45,7 @@ interface FlagsDef extends DockerConnectionCliFlags { 'splash-image'?: string; 'dont-check-arch': boolean; 'pin-device-to-release': boolean; + 'additional-space'?: number; 'add-certificate'?: string[]; help: void; } @@ -113,6 +114,11 @@ manually pinned using https://github.com/balena-io-projects/staged-releases .\ 'pin the preloaded device to the preloaded release on provision', char: 'p', }), + 'additional-space': flags.integer({ + description: + 'expand the image by this amount of bytes instead of automatically estimating the required amount', + parse: (x) => parseAsInteger(x, 'additional-space'), + }), 'add-certificate': flags.string({ description: `\ Add the given certificate (in PEM format) to /etc/ssl/certs in the preloading container. @@ -209,6 +215,7 @@ Can be repeated to add multiple certificates.\ const appId = options.app; const splashImage = options['splash-image']; + const additionalSpace = options['additional-space']; const dontCheckArch = options['dont-check-arch'] || false; const pinDevice = options['pin-device-to-release'] || false; @@ -240,6 +247,7 @@ Can be repeated to add multiple certificates.\ dontCheckArch, pinDevice, certificates, + additionalSpace, ); let gotSignal = false;