From 06f60944015751f5dcf236be75a6575895389875 Mon Sep 17 00:00:00 2001 From: Paulo Castro Date: Sun, 19 Dec 2021 23:38:06 +0000 Subject: [PATCH] os configure: Remove deprecated '--device-api-key' option Change-type: major --- docs/balena-cli.md | 8 -------- lib/commands/os/configure.ts | 26 +------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index 1a694b51..084c183d 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -2136,9 +2136,6 @@ are multiple files to inject. See connection profile examples and reference at: https://www.balena.io/docs/reference/OS/network/2.x/ https://developer.gnome.org/NetworkManager/stable/ref-settings.html -The --device-api-key option is deprecated and will be removed in a future release. -A suitable key is automatically generated or fetched if this option is omitted. - Fleets may be specified by fleet name, slug, or numeric ID. Fleet slugs are the recommended option, as they are unique and unambiguous. Slugs can be listed with the `balena fleets` command. Note that slugs may change if the @@ -2159,7 +2156,6 @@ https://docs.microsoft.com/en-us/windows/wsl/about Examples: $ balena os configure ../path/rpi3.img --device 7cf02a6 - $ balena os configure ../path/rpi3.img --device 7cf02a6 --device-api-key $ balena os configure ../path/rpi3.img --fleet myorg/myfleet $ balena os configure ../path/rpi3.img --fleet MyFleet --version 2.12.7 $ balena os configure ../path/rpi3.img -f MyFinFleet --device-type raspberrypi3 @@ -2205,10 +2201,6 @@ WiFi SSID (network name) (non-interactive configuration) device UUID -#### -k, --device-api-key DEVICE-API-KEY - -custom device API key (DEPRECATED and only supported with balenaOS 2.0.3+) - #### --device-type DEVICE-TYPE device type slug (e.g. "raspberrypi3") to override the fleet device type diff --git a/lib/commands/os/configure.ts b/lib/commands/os/configure.ts index 9206c8a6..fed84a19 100644 --- a/lib/commands/os/configure.ts +++ b/lib/commands/os/configure.ts @@ -36,7 +36,6 @@ interface FlagsDef { 'config-wifi-key'?: string; 'config-wifi-ssid'?: string; device?: string; // device UUID - 'device-api-key'?: string; 'device-type'?: string; help?: void; version?: string; @@ -59,10 +58,6 @@ interface Answers { provisioningKeyName?: string; } -const deviceApiKeyDeprecationMsg = stripIndent` - The --device-api-key option is deprecated and will be removed in a future release. - A suitable key is automatically generated or fetched if this option is omitted.`; - export default class OsConfigureCmd extends Command { public static description = stripIndent` Configure a previously downloaded balenaOS image. @@ -86,8 +81,6 @@ export default class OsConfigureCmd extends Command { https://www.balena.io/docs/reference/OS/network/2.x/ https://developer.gnome.org/NetworkManager/stable/ref-settings.html - ${deviceApiKeyDeprecationMsg.split('\n').join('\n\t\t')} - ${applicationIdInfo.split('\n').join('\n\t\t')} Note: This command is currently not supported on Windows natively. Windows users @@ -98,7 +91,6 @@ export default class OsConfigureCmd extends Command { public static examples = [ '$ balena os configure ../path/rpi3.img --device 7cf02a6', - '$ balena os configure ../path/rpi3.img --device 7cf02a6 --device-api-key ', '$ balena os configure ../path/rpi3.img --fleet myorg/myfleet', '$ balena os configure ../path/rpi3.img --fleet MyFleet --version 2.12.7', '$ balena os configure ../path/rpi3.img -f MyFinFleet --device-type raspberrypi3', @@ -142,11 +134,6 @@ export default class OsConfigureCmd extends Command { description: 'WiFi SSID (network name) (non-interactive configuration)', }), device: { ...cf.device, exclusive: ['fleet', 'provisioning-key-name'] }, - 'device-api-key': flags.string({ - char: 'k', - description: - 'custom device API key (DEPRECATED and only supported with balenaOS 2.0.3+)', - }), 'device-type': flags.string({ description: 'device type slug (e.g. "raspberrypi3") to override the fleet device type', @@ -241,11 +228,7 @@ export default class OsConfigureCmd extends Command { if (_.isEmpty(configJson)) { if (device) { - configJson = await generateDeviceConfig( - device, - options['device-api-key'], - answers, - ); + configJson = await generateDeviceConfig(device, undefined, answers); } else { configJson = await generateApplicationConfig(app!, answers); } @@ -316,13 +299,6 @@ async function validateOptions(options: FlagsDef) { "The '--device-type' option can only be used in conjunction with the '--fleet' option", ); } - if (options['device-api-key']) { - console.error(stripIndent` - ------------------------------------------------------------------------------------------- - Warning: ${deviceApiKeyDeprecationMsg.split('\n').join('\n\t\t\t')} - ------------------------------------------------------------------------------------------- - `); - } await Command.checkLoggedIn(); }