Skip to content

Commit ec9182b

Browse files
committed
fix compute exec stream close handling
1 parent bd64a54 commit ec9182b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/cmd/compute/exec.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ func newComputeExec() *cobra.Command {
6868
// nolint:wrapcheck
6969
return err
7070
}
71+
defer stream.Close()
7172

7273
for stream.Receive() {
7374
msg := stream.Msg()
@@ -78,6 +79,7 @@ func newComputeExec() *cobra.Command {
7879
fmt.Fprint(os.Stderr, v.Stderr)
7980
case *civ1.ExecuteCommandResponse_ExitCode:
8081
if v.ExitCode != 0 {
82+
stream.Close()
8183
os.Exit(int(v.ExitCode))
8284
}
8385
}

0 commit comments

Comments
 (0)