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