mirror of
https://github.com/openziti/zrok.git
synced 2024-11-07 08:44:14 +01:00
remove any frontend records assigned to an environment when the environment (#171)
This commit is contained in:
parent
ea2e4c8a98
commit
8bf060f71d
@ -117,6 +117,15 @@ func (h *disableHandler) removeEnvironment(envId int, tx *sqlx.Tx) error {
|
||||
return errors.Wrapf(err, "error deleting share '%d' for environment '%d'", shr.Id, envId)
|
||||
}
|
||||
}
|
||||
fes, err := str.FindFrontendsForEnvironment(envId, tx)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "error finding frontends for environment '%d'", envId)
|
||||
}
|
||||
for _, fe := range fes {
|
||||
if err := str.DeleteFrontend(fe.Id, tx); err != nil {
|
||||
return errors.Wrapf(err, "error deleting frontend '%d' for environment '%d'", fe.Id, envId)
|
||||
}
|
||||
}
|
||||
if err := str.DeleteEnvironment(envId, tx); err != nil {
|
||||
return errors.Wrapf(err, "error deleting environment '%d'", envId)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user