Allow fleet name aside from fleet slug for importing releases.

Change-type: patch
Signed-off-by: Carlo Miguel F. Cruz <carloc@balena.io>
This commit is contained in:
Carlo Miguel F. Cruz 2024-09-16 16:44:19 +08:00
parent e67e500bf4
commit 8a588706bb
No known key found for this signature in database
GPG Key ID: 997DBC01FCE3FD53

View File

@ -86,15 +86,14 @@ export default class ReleaseImportCmd extends Command {
);
}
const application = await balena.models.application.get(params.fleet, {
$select: ['id'],
});
const { getApplication } = await import('../../utils/sdk');
const application = (await getApplication(balena, params.fleet)).id;
if (application == null) {
throw new ExpectedError(`Fleet ${params.fleet} not found`);
}
await apply({
sdk: balena,
application: application.id,
application,
stream: bundle,
version: options['override-version'],
});