Package io.fabric8.kubernetes.client.dsl
Interface ExecWatch
-
- All Superinterfaces:
AutoCloseable,Closeable
public interface ExecWatch extends Closeable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Gracefully close the Watch - the close message will not be sent until all pending messages have been sent.CompletableFuture<Integer>exitCode()Get a future that will be completed with the exit code.InputStreamgetError()Gets theInputStreamfor stdErr ifTtyExecErrorable.redirectingError()has been called.InputStreamgetErrorChannel()Gets theInputStreamassociated with channel 3, which returns the final Status containing the exit code, which could indicate abnormal termination.OutputStreamgetInput()Gets theOutputStreamfor stdIn ifContainerResource.redirectingInput()has been called.InputStreamgetOutput()Gets theInputStreamfor stdOut ifTtyExecOutputErrorable.redirectingOutput()has been called.voidresize(int cols, int rows)
-
-
-
Method Detail
-
getInput
OutputStream getInput()
Gets theOutputStreamfor stdIn ifContainerResource.redirectingInput()has been called.Closing this stream does not immediately force sending. You will typically call
close()after you are finished writing - the close message will not be sent until all pending messages have been sent.- Returns:
- the stdIn stream
-
getOutput
InputStream getOutput()
Gets theInputStreamfor stdOut ifTtyExecOutputErrorable.redirectingOutput()has been called.- Returns:
- the stdOut stream
-
getError
InputStream getError()
Gets theInputStreamfor stdErr ifTtyExecErrorable.redirectingError()has been called.- Returns:
- the stdErr stream
-
getErrorChannel
InputStream getErrorChannel()
Gets theInputStreamassociated with channel 3, which returns the final Status containing the exit code, which could indicate abnormal termination.See also
exitCode()- Returns:
- the channel 3 stream
-
close
void close()
Gracefully close the Watch - the close message will not be sent until all pending messages have been sent.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
resize
void resize(int cols, int rows)
-
exitCode
CompletableFuture<Integer> exitCode()
Get a future that will be completed with the exit code.Will be -1 if the exit code can't be determined from the status, or null if close is received before the exit code.
See https://github.com/kubernetes/kubernetes/issues/89899 - which explains there's currently no way to indicate end of input over a websocket, so you may not get an exit code when using stdIn.Can be used as an alternative to
ExecListener.onFailure(Throwable, io.fabric8.kubernetes.client.dsl.ExecListener.Response)andExecListener.onExit(int, io.fabric8.kubernetes.api.model.Status)methods.- Returns:
- the exit code future
-
-