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 (target start): curveadm target start timeout #364

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions internal/task/step/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ type (
ContainerExec struct {
ContainerId *string
Command string
Detached bool
Success *bool
Out *string
module.ExecOptions
Expand Down Expand Up @@ -289,6 +290,9 @@ func (s *ListContainers) Execute(ctx *context.Context) error {

func (s *ContainerExec) Execute(ctx *context.Context) error {
cli := ctx.Module().DockerCli().ContainerExec(*s.ContainerId, s.Command)
if s.Detached {
cli.AddOption("--detach")
}
out, err := cli.Execute(s.ExecOptions)
return PostHandle(s.Success, s.Out, out, err, errno.ERR_RUN_COMMAND_IN_CONTAINER_FAILED.FD("(%s exec CONTAINER COMMAND)", s.ExecWithEngine))
}
Expand Down
3 changes: 2 additions & 1 deletion internal/task/task/bs/start_tgtd.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ func NewStartTargetDaemonTask(curveadm *cli.CurveAdm, cc *configure.ClientConfig
ExecOptions: curveadm.ExecOptions(),
})
t.AddStep(&step.ContainerExec{
Command: "tgtd -f &",
Command: "tgtd -f",
Detached: true,
ContainerId: &containerId,
ExecOptions: curveadm.ExecOptions(),
})
Expand Down