Shutdown gracefully tears down everything started by Start. It is synchronous: when Shutdown returns, no goroutine spawned by the operator is still running and every TCP port / unix socket / file descriptor opened during Start has been released. Subsequent calls return the original shutdown error.
(ctx context.Context)
| 251 | // informers and HTTP servers; if it has no deadline DefaultShutdownTimeout |
| 252 | // is applied automatically. |
| 253 | func (op *ShellOperator) Shutdown(ctx context.Context) error { |
| 254 | op.shutdownOnce.Do(func() { |
| 255 | op.shutdownErr = op.doShutdown(ctx) |
| 256 | }) |
| 257 | return op.shutdownErr |
| 258 | } |
| 259 | |
| 260 | func (op *ShellOperator) doShutdown(ctx context.Context) error { |
| 261 | if _, ok := ctx.Deadline(); !ok { |