mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-20 19:09:07 +01:00
Delete ephemeral machines on logout
Update changelog Use dedicated method to delete
This commit is contained in:
parent
4de49f5f49
commit
afae1ff7b6
@ -11,6 +11,7 @@
|
|||||||
- Report if a machine is online in CLI more accurately [#1062](https://github.com/juanfont/headscale/pull/1062)
|
- Report if a machine is online in CLI more accurately [#1062](https://github.com/juanfont/headscale/pull/1062)
|
||||||
- Added config option for custom DNS records [#1035](https://github.com/juanfont/headscale/pull/1035)
|
- Added config option for custom DNS records [#1035](https://github.com/juanfont/headscale/pull/1035)
|
||||||
- Expire nodes based on OIDC token expiry [#1067](https://github.com/juanfont/headscale/pull/1067)
|
- Expire nodes based on OIDC token expiry [#1067](https://github.com/juanfont/headscale/pull/1067)
|
||||||
|
- Remote ephemeral nodes on logout [#1098](https://github.com/juanfont/headscale/pull/1098)
|
||||||
|
|
||||||
## 0.17.1 (2022-12-05)
|
## 0.17.1 (2022-12-05)
|
||||||
|
|
||||||
|
@ -622,6 +622,20 @@ func (h *Headscale) handleMachineLogOutCommon(
|
|||||||
Caller().
|
Caller().
|
||||||
Err(err).
|
Err(err).
|
||||||
Msg("Failed to write response")
|
Msg("Failed to write response")
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if machine.isEphemeral() {
|
||||||
|
err = h.HardDeleteMachine(&machine)
|
||||||
|
if err != nil {
|
||||||
|
log.Error().
|
||||||
|
Err(err).
|
||||||
|
Str("machine", machine.Hostname).
|
||||||
|
Msg("Cannot delete ephemeral machine from the database")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
|
Loading…
Reference in New Issue
Block a user