Closed glenjamin closed 6 years ago
Hey @glenjamin, would love to merge a pull request adding support for streaming!
I had a bit of a look into this. It seems doable but a bit more invasive than i'd initially hoped.
A high level outline of what is required to do this properly:
plan
and resource_list
Printer.process_stream
and process_string
around, so print delegates to streamTerraformPlan
code to work on chunks - see this treetop threadThis would be cool as you'd also get incremental feedback - and could even maybe pass-through some of the underlying terraform incremental feedback messages?
While writing this up I realised this is overthinking it somewhat, and there's a cheat's way to do this:
Printer.process_stream
so that it also treats the apply
prompt as the end of the inputI'm going to have a go at the latter at some point, and I might have a go at the former if i'm feeling adventurous.
Implemented in #54.
Do you think it's worth leaving an issue open for full streaming support in case someone else runs into it and wants to give it a go?
As
terraform apply
now produces a diff and then prompts for ayes
to apply, it would be neat if landscape could handle this too.I hope this would mostly be a case of streaming the output through rather than buffering - but it might be more involved.