mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-18 02:39:49 +00:00
Fix application isLegacy check for rename and deploy
Change-type: patch
This commit is contained in:
parent
b0cae93ac9
commit
ecf4b046b5
@ -340,7 +340,7 @@ ${dockerignoreHelp}
|
||||
);
|
||||
|
||||
let release: Release | ComposeReleaseInfo['release'];
|
||||
if (appType?.is_legacy) {
|
||||
if (appType.slug === 'legacy-v1' || appType.slug === 'legacy-v2') {
|
||||
const { deployLegacy } = require('../utils/deploy-legacy');
|
||||
|
||||
const msg = getChalk().yellow(
|
||||
|
@ -80,7 +80,7 @@ export default class FleetRenameCmd extends Command {
|
||||
const application = await getApplication(balena, params.fleet, {
|
||||
$expand: {
|
||||
application_type: {
|
||||
$select: ['is_legacy'],
|
||||
$select: ['slug'],
|
||||
},
|
||||
},
|
||||
});
|
||||
@ -92,7 +92,7 @@ export default class FleetRenameCmd extends Command {
|
||||
|
||||
// Check app supports renaming
|
||||
const appType = (application.application_type as ApplicationType[])?.[0];
|
||||
if (appType.is_legacy) {
|
||||
if (appType.slug === 'legacy-v1' || appType.slug === 'legacy-v2') {
|
||||
throw new ExpectedError(
|
||||
`Fleet ${params.fleet} is of 'legacy' type, and cannot be renamed.`,
|
||||
);
|
||||
|
@ -184,7 +184,7 @@ export async function getAppWithArch(
|
||||
const options: BalenaSdk.PineOptions<BalenaSdk.Application> = {
|
||||
$expand: {
|
||||
application_type: {
|
||||
$select: ['name', 'slug', 'supports_multicontainer', 'is_legacy'],
|
||||
$select: ['name', 'slug', 'supports_multicontainer'],
|
||||
},
|
||||
is_for__device_type: {
|
||||
$select: 'slug',
|
||||
|
@ -6,7 +6,7 @@
|
||||
"name": "Starter",
|
||||
"slug": "microservices-starter",
|
||||
"supports_multicontainer": true,
|
||||
"is_legacy": false,
|
||||
"is_legacy": true,
|
||||
"__metadata": {}
|
||||
}
|
||||
],
|
||||
|
@ -6,7 +6,7 @@
|
||||
"name": "Starter",
|
||||
"slug": "microservices-starter",
|
||||
"supports_multicontainer": true,
|
||||
"is_legacy": false,
|
||||
"is_legacy": true,
|
||||
"__metadata": {}
|
||||
}
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user