diff --git a/hscontrol/db/machine.go b/hscontrol/db/machine.go index 60d93c98..3cf0465f 100644 --- a/hscontrol/db/machine.go +++ b/hscontrol/db/machine.go @@ -318,11 +318,8 @@ func (hsdb *HSDatabase) MachineSetExpiry(machine *types.Machine, expiry time.Tim } func (hsdb *HSDatabase) machineSetExpiry(machine *types.Machine, expiry time.Time) error { - now := time.Now() - if err := hsdb.db.Model(machine).Updates(types.Machine{ - LastSuccessfulUpdate: &now, - Expiry: &expiry, + Expiry: &expiry, }).Error; err != nil { return fmt.Errorf( "failed to refresh machine (update expiration) in the database: %w", diff --git a/hscontrol/grpcv1.go b/hscontrol/grpcv1.go index c9ab5168..d516ab94 100644 --- a/hscontrol/grpcv1.go +++ b/hscontrol/grpcv1.go @@ -532,9 +532,8 @@ func (api headscaleV1APIServer) DebugCreateMachine( GivenName: givenName, User: *user, - Expiry: &time.Time{}, - LastSeen: &time.Time{}, - LastSuccessfulUpdate: &time.Time{}, + Expiry: &time.Time{}, + LastSeen: &time.Time{}, HostInfo: types.HostInfo(hostinfo), } diff --git a/hscontrol/types/machine.go b/hscontrol/types/machine.go index 9a869021..534a0d13 100644 --- a/hscontrol/types/machine.go +++ b/hscontrol/types/machine.go @@ -53,9 +53,8 @@ type Machine struct { AuthKeyID uint AuthKey *PreAuthKey - LastSeen *time.Time - LastSuccessfulUpdate *time.Time - Expiry *time.Time + LastSeen *time.Time + Expiry *time.Time HostInfo HostInfo Endpoints StringList @@ -246,12 +245,6 @@ func (machine *Machine) Proto() *v1.Machine { machineProto.LastSeen = timestamppb.New(*machine.LastSeen) } - if machine.LastSuccessfulUpdate != nil { - machineProto.LastSuccessfulUpdate = timestamppb.New( - *machine.LastSuccessfulUpdate, - ) - } - if machine.Expiry != nil { machineProto.Expiry = timestamppb.New(*machine.Expiry) }