MCPcopy Index your code
hub / github.com/coder/coder / provisionLogWriter

Method provisionLogWriter

provisioner/terraform/executor.go:645–651  ·  view source on GitHub ↗

provisionLogWriter creates a WriteCloser that will log each JSON formatted terraform log. The WriteCloser must be closed by the caller to end logging, after which the returned channel will be closed to indicate that logging of the written data has finished. Failure to close the WriteCloser will le

(sink logSink)

Source from the content-addressed store, hash-verified

643// closed by the caller to end logging, after which the returned channel will be closed to indicate that logging of the
644// written data has finished. Failure to close the WriteCloser will leak a goroutine.
645func (e *executor) provisionLogWriter(sink logSink) (io.WriteCloser, <-chan any) {
646 r, w := io.Pipe()
647 done := make(chan any)
648
649 go e.provisionReadAndLog(sink, r, done)
650 return w, done
651}
652
653func (e *executor) provisionReadAndLog(sink logSink, r io.Reader, done chan<- any) {
654 defer close(done)

Callers 3

initMethod · 0.95
planMethod · 0.95
applyMethod · 0.95

Calls 1

provisionReadAndLogMethod · 0.95

Tested by

no test coverage detected