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

fix api invoke cmd args too long problem;add response when api invoke… #1088

Merged
merged 1 commit into from
Feb 26, 2021

Conversation

SquatsTonight
Copy link
Collaborator

新版本在 api-invoke 时未将 event 参数以 stdin 的形式传入,因此出现命令行过长的错误,目前已经修复;
增加了对 api-invoke 启动容器失败场景的处理,当 api-invoke 启动容器失败时,增加错误处理,使得程序不会意外退出。

// exit container
this.responseOfCustomContainer(res, respOfCustomContainer);
await docker.exitContainer(container);
} else {

const opts = await dockerOpts.generateLocalInvokeOpts(this.runtime,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看你这块逻辑改动了, 非 custom-container 全部从 generateLocalStartOpts 变成 generateLocalStartOpts

  1. generateLocalStartOpts 和 generateLocalStartOpts 的区别是什么

  2. 改动后, 会之前的行为有什么不一样

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. generateLocalStartOpts 和 generateLocalInvokeOpts 主要的不同在于前者的容器启动参数不需要设置 attackStdin 等参数,而后者是需要的,这是因为后者在 docker run 的时候需要将 event 从 stdin 输入,而前者是在 docker exec 时传入 payload 数据。
  2. 改动后只是变更了容器的启动参数,行为变化参考 1 。

为了解 echo 大字符串出现的问题,这里的逻辑后续会变更,变更后与 local start 保持一致。

@rsonghuster rsonghuster merged commit 6a73ad2 into master Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants