Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ✨ 针对accountid异常做出友好提示 #984

Merged
merged 2 commits into from
May 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/entry-public-method/index.ts
Original file line number Diff line number Diff line change
@@ -43,6 +43,12 @@ export default class EntryPublicMethod {
// 处理密钥
if (getSecretKey) {
inputs.credentials = await getCredentials(inputs.credentials, inputs.project?.access);
if (_.isEmpty(inputs.credentials?.AccountID)) {
const access = inputs.project?.access;
const tip = `请使用 s config add --AccountID xxxxx --AccessKeyID xxxxx --AccessKeySecret xxxxx --access ${access || 'default'} -f 强制覆盖旧的密钥,然后重试一次
Please use "s config add --AccountID xxxxx --AccessKeyID xxxxx --AccessKeySecret xxxxx --access ${access || 'default'} -f" to force overwrite the old key, then try again.`;
throw new core.CatchableError('Account id not obtained', tip);
}
}

setDefaultValue(inputs);
@@ -63,6 +69,12 @@ export default class EntryPublicMethod {
}));
}

// fc组件镜像 trim 左右空格
const image = _.get(inputs, 'props.function.customContainerConfig.image');
if (!_.isEmpty(image)) {
_.set(inputs, 'props.function.customContainerConfig.image', _.trim(image));
}

await InfraAsTemplate.modifyInputs(inputs); // 多环境处理

try {