Skip to content

Commit

Permalink
drop stdin for exec sync
Browse files Browse the repository at this point in the history
as i don't think there's a way it can be passed in

Signed-off-by: Peter Hunt~ <[email protected]>
  • Loading branch information
haircommander committed Sep 22, 2022
1 parent 0ad3325 commit b72a78b
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 160 deletions.
1 change: 0 additions & 1 deletion conmon-rs/common/proto/conmon.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ interface Conmon {
timeoutSec @1 :UInt64;
command @2 :List(Text);
terminal @3 :Bool;
stdin @4 :Bool;
}

struct ExecSyncContainerResponse {
Expand Down
3 changes: 1 addition & 2 deletions conmon-rs/server/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,11 @@ impl conmon::Server for Server {

let command = pry!(req.get_command());
let args = pry_err!(self.generate_exec_sync_args(&id, &pidfile, &container_io, &command));
let stdin = req.get_stdin();

Promise::from_future(
async move {
match child_reaper
.create_child(&runtime, &args, stdin, &mut container_io, &pidfile)
.create_child(&runtime, &args, false, &mut container_io, &pidfile)
.await
{
Ok((grandchild_pid, token)) => {
Expand Down
285 changes: 138 additions & 147 deletions internal/proto/conmon.capnp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,9 +666,6 @@ type ExecSyncConfig struct {

// Terminal specifies if a tty should be used.
Terminal bool

// Stdin indicates if stdin should be available or not.
Stdin bool
}

// ExecContainerResult is the result for calling the ExecSyncContainer method.
Expand Down Expand Up @@ -709,7 +706,6 @@ func (c *ConmonClient) ExecSyncContainer(ctx context.Context, cfg *ExecSyncConfi
return err
}
req.SetTerminal(cfg.Terminal)
req.SetStdin(cfg.Stdin)
if err := p.SetRequest(req); err != nil {
return fmt.Errorf("set request: %w", err)
}
Expand Down
6 changes: 0 additions & 6 deletions pkg/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ var _ = Describe("ConmonClient", func() {
ID: tr.ctrID,
Command: []string{"/busybox", "echo", "-n", "hello", "world", fmt.Sprintf("%d", i)},
Terminal: terminal,
Stdin: true,
Timeout: timeoutUnlimited,
})
Expect(err).To(BeNil())
Expand Down Expand Up @@ -301,7 +300,6 @@ var _ = Describe("ConmonClient", func() {
ID: tr.ctrID,
Command: []string{"/busybox", "echo", "-n", "hello", "world", fmt.Sprintf("%d", i)},
Terminal: terminal,
Stdin: true,
Timeout: timeoutUnlimited,
})

Expand Down Expand Up @@ -333,7 +331,6 @@ var _ = Describe("ConmonClient", func() {
ID: tr.ctrID,
Command: []string{"/busybox", "echo", "-n", "hello", "world"},
Timeout: timeoutUnlimited,
Stdin: true,
Terminal: terminal,
})

Expand Down Expand Up @@ -362,7 +359,6 @@ var _ = Describe("ConmonClient", func() {
Command: []string{"/busybox", "echo", "-n", "hello", "world"},
Timeout: 10,
Terminal: terminal,
Stdin: true,
})

Expect(err).To(BeNil())
Expand All @@ -383,7 +379,6 @@ var _ = Describe("ConmonClient", func() {
Command: []string{"/busybox", "invalid"},
Timeout: timeoutUnlimited,
Terminal: terminal,
Stdin: true,
})

Expect(err).To(BeNil())
Expand Down Expand Up @@ -414,7 +409,6 @@ var _ = Describe("ConmonClient", func() {
Command: []string{"/busybox", "sleep", "5"},
Timeout: 3,
Terminal: terminal,
Stdin: true,
})

Expect(err).To(BeNil())
Expand Down

0 comments on commit b72a78b

Please sign in to comment.