Skip to content

Commit a47c62d

Browse files
authored
Merge pull request #83 from devsapp/fix-model
fix: serverAddr 128 length
2 parents 2b6f854 + b164776 commit a47c62d

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

src/subCommands/deploy/impl/function.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,14 +405,17 @@ vpcConfig:
405405
}
406406
if (nasAuto) {
407407
const modelConfig = supplement?.modelConfig || annotations?.modelConfig;
408-
408+
let serverAddr= `${mountTargetDomain}:/${functionName}${isEmpty(modelConfig) ? '' : '/' + modelConfig.id}`;
409+
if (serverAddr.length > 128){
410+
serverAddr = serverAddr.substring(0, 128);
411+
}
409412
logger.write(
410413
yellow(`Created nas resource succeeded, please replace nasConfig: auto in yaml with:
411414
nasConfig:
412415
groupId: 0
413416
userId: 0
414417
mountPoints:
415-
- serverAddr: ${mountTargetDomain}:/${functionName}${isEmpty(modelConfig) ? '' : '/' + modelConfig.id}
418+
- serverAddr: ${serverAddr}
416419
mountDir: /mnt/${functionName}
417420
enableTLS: false\n`),
418421
);
@@ -422,7 +425,7 @@ nasConfig:
422425
userId: 0,
423426
mountPoints: [
424427
{
425-
serverAddr: `${mountTargetDomain}:/${functionName}${isEmpty(modelConfig) ? '' : '/' + modelConfig.id}`,
428+
serverAddr,
426429
mountDir: `/mnt/${functionName}`,
427430
enableTLS: false,
428431
},

src/subCommands/model/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,17 @@ vpcConfig:
104104
logger.info('[nasAuto] vpcAuto finished.');
105105
}
106106
if (nasAuto) {
107+
let serverAddr= `${mountTargetDomain}:/${functionName}/${modelConfig.id}`;
108+
if (serverAddr.length > 128){
109+
serverAddr = serverAddr.substring(0, 128);
110+
}
107111
logger.write(
108112
yellow(`[nasAuto] Created nas resource succeeded, please replace nasConfig: auto in yaml with:
109113
nasConfig:
110114
groupId: 0
111115
userId: 0
112116
mountPoints:
113-
- serverAddr: ${mountTargetDomain}:/${functionName}/${modelConfig.id}
117+
- serverAddr: ${serverAddr}
114118
mountDir: /mnt/${functionName}
115119
enableTLS: false\n`),
116120
);
@@ -120,7 +124,7 @@ mountPoints:
120124
userId: 0,
121125
mountPoints: [
122126
{
123-
serverAddr: `${mountTargetDomain}:/${functionName}/${modelConfig.id}`,
127+
serverAddr,
124128
mountDir: `/mnt/${functionName}`,
125129
enableTLS: false,
126130
},

0 commit comments

Comments
 (0)