puppetlabs-toy-chest / wash

Wide Area SHell: a cloud-native shell for bringing remote infrastructure to your terminal.
https://puppetlabs.github.io/wash
Apache License 2.0
180 stars 29 forks source link

Common attribute for entry state #604

Open MikaelSmith opened 4 years ago

MikaelSmith commented 4 years ago

It's common for VMs, containers, and services to have a running/not-running state. Some operations - particularly exec, and thus reading the filesystem - don't work when a container or VM is not running.

We should add a common attribute for state. It's useful to know whether it's running - and thus can respond to exec and signals - or some other state. I would model this as a boolean running flag, and a free-form string that describes the state.

ls should be updated to display the state, and use color or other symbols to denote a running instance.

ekinanp commented 4 years ago

Hm, how do you intend to use the separate flag for running?

I think making state a string would be useful. People could specify the entry's possible states in the schema, and the color code for each state. We could have docs list this stuff.

MikaelSmith commented 4 years ago

I mentioned a uniform way of showing that an instance is running. Could also early fail Exec based on that.

ekinanp commented 4 years ago

Yeah, was mostly asking to confirm the latter. I think we should take a similar approach to signal and specify a set of common states (and color codes associated with that state). That should be enough to prevent people from (accidentally and interactively) running Exec on a non-running thing while providing a uniform way to show a running instance.