-
Notifications
You must be signed in to change notification settings - Fork 258
Description
We recently upgraded our Teletraan setup to the latest commit from master
and ran into issues where hosts stopped getting cleaned up when they where terminated. We were able to revert to the commit just before #831 was merged to restore this functionality. I'm no expert here, here is what I found out by digging into the PR.
The previous version of the cleanup code was split into two parts:
-
Cleaning up hosts that are individually assigned to environments
Previously handled by a function namedprocessIndividualHosts
, this function was renamed toprocessAllHosts
. (https://github.com/pinterest/teletraan/pull/831/files#diff-d325e9aa7284f0411829cb75934a0ddae12c7281fda3b09da7779c406e8bad3cR96)
The query backing this function has not changed much. It involved joininghosts
tohosts_and_envs
- it now involveshosts_and_agents
joined tohosts_and_envs
. -
Cleaning up hosts that are part of groups, those groups are assigned to environments
This was previously handled by a loop calling theprocessEachGroup
function on each group (https://github.com/pinterest/teletraan/pull/831/files#diff-d325e9aa7284f0411829cb75934a0ddae12c7281fda3b09da7779c406e8bad3cL124)
This functionality was removed by PR 831. I guess it was assumed that theprocessAllHosts
function would handle these hosts, however it only handles hosts that are directly attached to environments - not hosts that are part of groups.
Would it be possible to reintroduce the "cleanup stale hosts that are part of groups" functionality?
(Roughly these lines https://github.com/pinterest/teletraan/pull/831/files#diff-d325e9aa7284f0411829cb75934a0ddae12c7281fda3b09da7779c406e8bad3cL124-L173)
Thanks!