`waypoint exec` in a multi-workspace/nomad namespace project

I’m hoping that I’m mistaken about the behavior I’m observing, and the docs make no mention of waypoint exec's behavior with regard to workspaces. I’m observing that the workspace switch has no effect on exec, e.g. waypoint exec -workspace=<WORKSPACE NAME> can execute on a deployment in any workspace, regardless of the one specified.

waypoint exec works by picking a random running instance of the latest deployment and executing within that environment. Exec does not spin up a new dedicated instance. Please keep this in mind if you need to run resource intensive tasks since user traffic may be sharing the same instance.
Ref: Exec | Waypoint by HashiCorp

The “latest deployment” here seems to be key. Note that it does not say the “latest deployment in the specified workspace”. These docs imply, and my observations appear to confirm that the -workspace= argument to waypoint exec has no effect . That is, waypoint exec will connect you not only to the latest deployment, but the latest deployment from any workspace. So if you have dev and prod workpaces for example, and you’d like to execute something inside a deployment in the prod workspace, the only way to be certain that your exec connects to the prod workspace is to do a deploy to production, ensuring that the prod workspace deployment is the last, as waypoint exec will only connect to the last deployment.

I’m hoping someone here has more in depth knowledge of waypoint exec's deployment selection behavior. Does anyone know if this is the intended behavior? It’s quite surprising if it is.


Issue reported and pull request submitted: `waypoint exec` does not respect `-workspace` switch · Issue #3224 · hashicorp/waypoint · GitHub