- Notifications
You must be signed in to change notification settings - Fork22
Description
While thererun_on_start
andrun_on_stop
form a nice balance, somerun_on_start
scripts are actually meant to be balanced against arun_on_destroy
trigger. As an example, using therun_on_start
scripts to do agit clone
of packages for the workspace, you naturally would not want to delete those when the workspace is stopped, however you might want to delete them when the workspace is destroyed.
Agit clone
is of course not a perfect example as we have terraform modules to do that for us already, and furthermore most providers are relying upon the containerization/virtualization provider to do cleanup when workspaces are destroyed, but if there are persistent resources being managed bycoder_script
snippets, it would be incredibly handy to have arun_on_destroy
trigger to manage their lifecycles properly.
In my case, this is because I am using Coder to provide access directly to machines that have already been provisioned, and I useremote-exec
to SSH into the devices and install thecoder
agent, thencoder_script
snippets to set up all kinds of state. I would like to clean that up properly upon workspace destruction.