Bubble error up to user for rename

This commit is contained in:
Kristoffer Dalby 2022-04-24 20:56:28 +01:00
parent 14994cb6cc
commit 62808cbd86

View File

@ -215,7 +215,7 @@ func (api headscaleV1APIServer) ExpireMachine(
)
log.Trace().
Str("machine", machine.Name).
Str("machine", machine.Hostname).
Time("expiry", *machine.Expiry).
Msg("machine expired")
@ -231,13 +231,16 @@ func (api headscaleV1APIServer) RenameMachine(
return nil, err
}
api.h.RenameMachine(
err = api.h.RenameMachine(
machine,
request.GetNewName(),
)
if err != nil {
return nil, err
}
log.Trace().
Str("machine", machine.Name).
Str("machine", machine.Hostname).
Time("expiry", *machine.Expiry).
Msg("machine expired")
@ -393,7 +396,7 @@ func (api headscaleV1APIServer) DebugCreateMachine(
newMachine := Machine{
MachineKey: request.GetKey(),
Name: request.GetName(),
Hostname: request.GetName(),
Namespace: *namespace,
Expiry: &time.Time{},