From 0f53ab3b4e096a14c24dd5b38fefe20b216b417d Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 3 Dec 2024 08:27:55 -0500 Subject: [PATCH] generateApiKey Change-type: patch --- src/utils/config.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/utils/config.ts b/src/utils/config.ts index e3a91676..5978e2d6 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ import type * as BalenaSdk from 'balena-sdk'; -import * as semver from 'balena-semver'; import { getBalenaSdk, stripIndent } from './lazy'; export interface ImgConfig { @@ -122,16 +121,10 @@ export function generateDeviceConfig( // os.getConfig always returns a config for an app delete config.apiKey; - if (deviceApiKey == null && semver.satisfies(options.version, '<2.0.3')) { - config.apiKey = await sdk.models.application.generateApiKey( - application.id, - ); - } else { - config.deviceApiKey = - typeof deviceApiKey === 'string' && deviceApiKey - ? deviceApiKey - : await sdk.models.device.generateDeviceKey(device.uuid); - } + config.deviceApiKey = + typeof deviceApiKey === 'string' && deviceApiKey + ? deviceApiKey + : await sdk.models.device.generateDeviceKey(device.uuid); return config; })