File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export class Cp {
3636 const writerStream = fs . createWriteStream ( tmpFileName ) ;
3737 const errStream = new WritableStreamBuffer ( ) ;
3838 return new Promise < void > ( ( resolve , reject ) => {
39- this . execInstance
39+ const conn = await this . execInstance
4040 . exec (
4141 namespace ,
4242 podName ,
@@ -67,6 +67,9 @@ export class Cp {
6767 } ,
6868 )
6969 . catch ( reject ) ;
70+ conn . onclose = ( event ) => {
71+ resolve ( ) ;
72+ } ;
7073 } ) ;
7174 }
7275
@@ -92,7 +95,7 @@ export class Cp {
9295 const readStream = fs . createReadStream ( tmpFileName ) ;
9396 const errStream = new WritableStreamBuffer ( ) ;
9497 return new Promise < void > ( ( resolve , reject ) => {
95- this . execInstance
98+ const conn = await this . execInstance
9699 . exec (
97100 namespace ,
98101 podName ,
@@ -116,6 +119,9 @@ export class Cp {
116119 } ,
117120 )
118121 . catch ( reject ) ;
122+ conn . onclose = ( event ) => {
123+ resolve ( ) ;
124+ } ;
119125 } ) ;
120126 }
121127}
You can’t perform that action at this time.
0 commit comments