提交 0ad6b6ee 编写于 作者: G gaohuatao

iSulad: fix isula&crictl exec -ti params default value

Signed-off-by: Ngaohuatao <gaohuatao@huawei.com>
(cherry picked from commit 95218c3d17d76d324c6409699e381bdaef6d3d24)
Signed-off-by: Ngaohuatao <gaohuatao@huawei.com>
上级 af6a8590
......@@ -422,10 +422,8 @@ int cmd_exec_main(int argc, const char **argv)
custom_cfg = &g_cmd_exec_args.custom_conf;
custom_cfg->tty = true;
custom_cfg->open_stdin = true;
custom_cfg->attach_stdout = true;
custom_cfg->attach_stderr = false;
custom_cfg->attach_stderr = true;
custom_cfg->attach_stdin = custom_cfg->open_stdin;
if (g_cmd_exec_args.detach) {
......
......@@ -124,6 +124,9 @@ typedef struct _engine_exec_request_t {
int64_t timeout;
const char *suffix;
bool tty;
bool open_stdin;
} engine_exec_request_t;
......
......@@ -382,6 +382,11 @@ int rt_lcr_exec(const char *id, const char *runtime, const rt_exec_params_t *par
request.user = user;
}
request.open_stdin = params->attach_stdin;
if (params->spec != NULL) {
request.tty = params->spec->terminal;
}
if (!engine_ops->engine_exec_op(&request, exit_code)) {
const char *tmpmsg = NULL;
if (engine_ops->engine_get_errmsg_op != NULL) {
......
......@@ -94,6 +94,7 @@ typedef struct _rt_exec_params_t {
int64_t timeout;
const char *suffix;
defs_process *spec;
bool attach_stdin;
} rt_exec_params_t;
typedef struct _rt_pause_params_t {
......
......@@ -1312,8 +1312,8 @@ void CRIRuntimeServiceImpl::ExecSyncFromGRPC(const std::string &containerID,
error.SetError("Out of memory");
return;
}
(*request)->tty = true;
(*request)->attach_stdin = true;
(*request)->tty = false;
(*request)->attach_stdin = false;
(*request)->attach_stdout = true;
(*request)->attach_stderr = true;
(*request)->timeout = timeout;
......
......@@ -542,6 +542,7 @@ static int exec_container(container_t *cont, const char *runtime, char * const c
params.suffix = request->suffix;
params.state = cont->state_path;
params.spec = process_spec;
params.attach_stdin = request->attach_stdin;
if (runtime_exec(cont->common_config->id, runtime, &params, exit_code)) {
ERROR("Runtime exec container failed");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册