Skip to content

Commit

Permalink
Bubble error up to user for rename
Browse files Browse the repository at this point in the history
  • Loading branch information
kradalby committed Apr 24, 2022
1 parent 14994cb commit 62808cb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions grpcv1.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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")

Expand Down Expand Up @@ -393,7 +396,7 @@ func (api headscaleV1APIServer) DebugCreateMachine(

newMachine := Machine{
MachineKey: request.GetKey(),
Name: request.GetName(),
Hostname: request.GetName(),
Namespace: *namespace,

Expiry: &time.Time{},
Expand Down

0 comments on commit 62808cb

Please sign in to comment.