Open dminkovsky opened 6 years ago
For now using this as a workaround to stream the latest build request:
gcloud container builds list | head -2 | awk 'NR>1{print $1}' | xargs gcloud container builds log --stream
Having examined gcloud container builds log --stream
with --log-http
, it appears to works like this:
WORKING
Range: bytes=0-
.content-length
.WORKING
, then subsequent storage log requests change the Range
header's value to offset from already received data. For example. if the first storage log response was content-length: 1650
, the next storage log request will be Range: bytes=1650-
and so on.Could also explore forking gcloud container builds log --stream
using Node's spawn
instead of currently used exec
.
Current mechanism (streaming output from a forked
gcloud
) seems unreliable. Examine the callgcloud container builds log --stream
makes with--log-http
and use that with an equivalent HTTP call.