integration: replace time.Sleep with assert.EventuallyWithT (#2680)
This commit is contained in:
parent
b904276f2b
commit
c6d7b512bd
73 changed files with 584 additions and 573 deletions
|
|
@ -98,7 +98,6 @@ func (h *Headscale) handleExistingNode(
|
|||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
n, policyChanged, err := h.state.SetNodeExpiry(node.ID, requestExpiry)
|
||||
|
|
@ -169,7 +168,6 @@ func (h *Headscale) handleRegisterWithAuthKey(
|
|||
regReq tailcfg.RegisterRequest,
|
||||
machineKey key.MachinePublic,
|
||||
) (*tailcfg.RegisterResponse, error) {
|
||||
|
||||
node, changed, err := h.state.HandleNodeFromPreAuthKey(
|
||||
regReq,
|
||||
machineKey,
|
||||
|
|
@ -178,9 +176,11 @@ func (h *Headscale) handleRegisterWithAuthKey(
|
|||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
return nil, NewHTTPError(http.StatusUnauthorized, "invalid pre auth key", nil)
|
||||
}
|
||||
if perr, ok := err.(types.PAKError); ok {
|
||||
var perr types.PAKError
|
||||
if errors.As(err, &perr) {
|
||||
return nil, NewHTTPError(http.StatusUnauthorized, perr.Error(), nil)
|
||||
}
|
||||
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue