Implement ExpireMachine rpc
This commit is contained in:
parent
f1c05f8010
commit
bd1d1b1a3b
3 changed files with 64 additions and 0 deletions
|
@ -262,6 +262,14 @@ func (h *Headscale) UpdateMachine(machine *Machine) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ExpireMachine takes a Machine struct and sets the expire field to now.
|
||||
func (h *Headscale) ExpireMachine(machine *Machine) {
|
||||
now := time.Now()
|
||||
machine.Expiry = &now
|
||||
|
||||
h.db.Save(machine)
|
||||
}
|
||||
|
||||
// DeleteMachine softs deletes a Machine from the database.
|
||||
func (h *Headscale) DeleteMachine(machine *Machine) error {
|
||||
err := h.RemoveSharedMachineFromAllNamespaces(machine)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue