@@ -12,7 +12,7 @@ const imageManager = require('../appSecurity/imageManager');
1212// const advancedWorkflows = require('../appLifecycle/advancedWorkflows'); // Moved to dynamic require to avoid circular dependency
1313// eslint-disable-next-line no-unused-vars
1414const { supportedArchitectures, enterpriseRequiredArchitectures } = require ( '../utils/appConstants' ) ;
15- const { specificationFormatter } = require ( '../utils/appUtilities' ) ;
15+ const { specificationFormatter, findCommonArchitectures } = require ( '../utils/appUtilities' ) ;
1616const { checkAndDecryptAppSpecs } = require ( '../utils/enterpriseHelper' ) ;
1717const portManager = require ( '../appNetwork/portManager' ) ;
1818const {
@@ -1285,30 +1285,21 @@ async function verifyAppSpecifications(appSpecifications, height, checkDockerAnd
12851285 const isEnterpriseArcane = appSpecifications . version >= 8 && appSpecifications . enterprise ;
12861286
12871287 if ( isEnterpriseArcane ) {
1288- // Enterprise Arcane apps (v8+) must support amd64 on ALL components (Arcane nodes are amd64-only)
1289- const componentsWithoutAmd64 = componentArchitectures . filter (
1290- ( comp ) => ! comp . architectures . includes ( 'amd64' ) ,
1288+ // Enterprise Arcane apps (v8+) must support required architectures on ALL components (Arcane nodes are amd64-only)
1289+ const componentsWithoutRequiredArchs = componentArchitectures . filter (
1290+ ( comp ) => ! enterpriseRequiredArchitectures . every ( ( arch ) => comp . architectures . includes ( arch ) ) ,
12911291 ) ;
12921292
1293- if ( componentsWithoutAmd64 . length > 0 ) {
1294- const componentNames = componentsWithoutAmd64 . map ( ( c ) => `${ c . name } (${ c . repotag } )` ) . join ( ', ' ) ;
1293+ if ( componentsWithoutRequiredArchs . length > 0 ) {
1294+ const componentNames = componentsWithoutRequiredArchs . map ( ( c ) => `${ c . name } (${ c . repotag } )` ) . join ( ', ' ) ;
12951295 throw new Error (
12961296 `Enterprise application '${ appSpecifications . name } ' must support ${ enterpriseRequiredArchitectures . join ( ', ' ) } `
1297- + `architecture on ALL components. The following components do not support amd64 : ${ componentNames } . `
1297+ + `architecture on ALL components. The following components do not support ${ enterpriseRequiredArchitectures . join ( ', ' ) } : ${ componentNames } . `
12981298 + `Arcane nodes are amd64-only.` ,
12991299 ) ;
13001300 }
13011301 } else {
13021302 // Non-enterprise apps: must have at least ONE common architecture across all components
1303- const findCommonArchitectures = ( compArchs ) => {
1304- if ( compArchs . length === 0 ) return [ ] ;
1305- if ( compArchs . length === 1 ) return compArchs [ 0 ] . architectures ;
1306-
1307- return compArchs [ 0 ] . architectures . filter ( ( arch ) =>
1308- compArchs . every ( ( comp ) => comp . architectures . includes ( arch ) ) ,
1309- ) ;
1310- } ;
1311-
13121303 const commonArchitectures = findCommonArchitectures ( componentArchitectures ) ;
13131304
13141305 if ( commonArchitectures . length === 0 ) {
0 commit comments