mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-12 07:37:34 +00:00
new IP allocator and add postgres to integration tests. (#1756)
This commit is contained in:
@@ -620,6 +620,11 @@ func (h *Headscale) registerNodeForOIDCCallback(
|
||||
machineKey *key.MachinePublic,
|
||||
expiry time.Time,
|
||||
) error {
|
||||
addrs, err := h.ipAlloc.Next()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := h.db.DB.Transaction(func(tx *gorm.DB) error {
|
||||
if _, err := db.RegisterNodeFromAuthCallback(
|
||||
// TODO(kradalby): find a better way to use the cache across modules
|
||||
@@ -629,7 +634,7 @@ func (h *Headscale) registerNodeForOIDCCallback(
|
||||
user.Name,
|
||||
&expiry,
|
||||
util.RegisterMethodOIDC,
|
||||
h.cfg.IPPrefixes,
|
||||
addrs,
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user