mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-22 08:03:30 +01:00
Always return empty auto_groups if previously were nil (#468)
This commit is contained in:
parent
cd7d1a80c9
commit
6de313070a
@ -80,6 +80,8 @@ type SetupKey struct {
|
|||||||
|
|
||||||
// Copy copies SetupKey to a new object
|
// Copy copies SetupKey to a new object
|
||||||
func (key *SetupKey) Copy() *SetupKey {
|
func (key *SetupKey) Copy() *SetupKey {
|
||||||
|
autoGroups := make([]string, 0)
|
||||||
|
autoGroups = append(autoGroups, key.AutoGroups...)
|
||||||
if key.UpdatedAt.IsZero() {
|
if key.UpdatedAt.IsZero() {
|
||||||
key.UpdatedAt = key.CreatedAt
|
key.UpdatedAt = key.CreatedAt
|
||||||
}
|
}
|
||||||
@ -94,7 +96,7 @@ func (key *SetupKey) Copy() *SetupKey {
|
|||||||
Revoked: key.Revoked,
|
Revoked: key.Revoked,
|
||||||
UsedTimes: key.UsedTimes,
|
UsedTimes: key.UsedTimes,
|
||||||
LastUsed: key.LastUsed,
|
LastUsed: key.LastUsed,
|
||||||
AutoGroups: key.AutoGroups,
|
AutoGroups: autoGroups,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user