hashicorp / go-secure-stdlib

Mozilla Public License 2.0
64 stars 24 forks source link

plugincontainer: Add debug mode #91

Closed tomhjp closed 1 year ago

tomhjp commented 1 year ago

Adds a debug mode which does extra work to help diagnose why a plugin may have failed to start, and make it easier for users to re-run their plugins interactively to better understand their behaviour.

In particular, we disable the AutoRemove option in the Docker SDK when debug is enabled, otherwise we may end up in a race with the container runtime to salvage debug information before the container is killed and cleaned up.

We also only print environment variables in the diagnose notes if debug is enabled, as they could reasonably contain secrets the plugin needs to consume.

tomhjp commented 1 year ago

Thanks!