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