-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
stdout can be null according to the documentation.
Lines 1630 to 1643 in 47ac3bc
| /** | |
| * Start an exec instance | |
| * @param id Exec instance ID | |
| * @param stdout Optional stream to write stdout content | |
| * @param stderr Optional stream to write stderr content | |
| * @param execStartConfig Configuration options for starting the exec instance | |
| * @returns Promise that resolves when the exec instance completes | |
| */ | |
| public async execStart( | |
| id: string, | |
| stdout: stream.Writable | null, | |
| stderr: stream.Writable | null, | |
| execStartConfig?: types.ExecStartConfig, | |
| ): Promise<void> { |
But when it is null an error is thrown stating stdout is required to process stream.
Lines 1647 to 1678 in 47ac3bc
| if (isWritable(stdout)) { | |
| const response = await this.api.upgrade( | |
| `/exec/${id}/start`, | |
| execStartConfig, | |
| ); | |
| switch (response.content) { | |
| case DOCKER_RAW_STREAM: | |
| response.socket.pipe(stdout); | |
| break; | |
| case DOCKER_MULTIPLEXED_STREAM: | |
| if (isWritable(stderr)) { | |
| response.socket.pipe( | |
| demultiplexStream(stdout, stderr), | |
| ); | |
| break; | |
| } else { | |
| throw new Error( | |
| 'stderr is required to process multiplexed stream', | |
| ); | |
| } | |
| default: | |
| throw new Error( | |
| 'Unsupported content type: ' + response.content, | |
| ); | |
| } | |
| return new Promise((resolve, reject) => { | |
| response.socket.once('error', reject); | |
| response.socket.once('close', resolve); | |
| }); | |
| } else { | |
| throw new Error('stdout is required to process stream'); | |
| } |
Metadata
Metadata
Assignees
Labels
No labels