1- import _ from 'lodash' ;
1+ import _ , { isEmpty } from 'lodash' ;
22import { diffConvertYaml } from '@serverless-devs/diff' ;
33import inquirer from 'inquirer' ;
44import fs from 'fs' ;
@@ -319,7 +319,7 @@ export default class Service extends Base {
319319 * 生成 auto 资源,非 FC 资源,主要指 vpc、nas、log、role(oss mount 挂载点才有)
320320 */
321321 private async _deployAuto ( ) {
322- const { region } = this . inputs . props ;
322+ const { region, supplement } = this . inputs . props ;
323323 const { credential } = this . inputs ;
324324 const { functionName } = this . local ;
325325
@@ -390,13 +390,15 @@ vpcConfig:
390390 _ . set ( this . local , 'vpcConfig' , vpcConfig ) ;
391391 }
392392 if ( nasAuto ) {
393+ const { modelConfig } = supplement ;
394+
393395 logger . write (
394396 yellow ( `Created nas resource succeeded, please replace nasConfig: auto in yaml with:
395397nasConfig:
396398 groupId: 0
397399 userId: 0
398400 mountPoints:
399- - serverAddr: ${ mountTargetDomain } :/${ functionName }
401+ - serverAddr: ${ mountTargetDomain } :/${ functionName } ${ isEmpty ( modelConfig ) ? '' : '/' + modelConfig . id }
400402 mountDir: /mnt/${ functionName }
401403 enableTLS: false\n` ) ,
402404 ) ;
@@ -406,7 +408,7 @@ nasConfig:
406408 userId : 0 ,
407409 mountPoints : [
408410 {
409- serverAddr : `${ mountTargetDomain } :/${ functionName } ` ,
411+ serverAddr : `${ mountTargetDomain } :/${ functionName } ${ isEmpty ( modelConfig ) ? '' : '/' + modelConfig . id } ` ,
410412 mountDir : `/mnt/${ functionName } ` ,
411413 enableTLS : false ,
412414 } ,
0 commit comments