Merge pull request #2596 from balena-io/fix-is-legacy-check

Fix isLegacy check which should always relay on the slug
This commit is contained in:
Thodoris Greasidis 2023-03-10 18:24:48 +02:00 committed by GitHub
commit 4ec45a0c43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 6 deletions

View File

@ -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(

View File

@ -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.`,
);

View File

@ -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',

View File

@ -6,7 +6,7 @@
"name": "Starter",
"slug": "microservices-starter",
"supports_multicontainer": true,
"is_legacy": false,
"is_legacy": true,
"__metadata": {}
}
],

View File

@ -6,7 +6,7 @@
"name": "Starter",
"slug": "microservices-starter",
"supports_multicontainer": true,
"is_legacy": false,
"is_legacy": true,
"__metadata": {}
}
],