mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-03 03:59:07 +02:00
[management] fix posture check flip evaluation for affected peers calc (#7347)
This commit is contained in:
@@ -93,7 +93,7 @@ func (a *Account) toNetworkMapData(
|
||||
}
|
||||
for _, pc := range a.PostureChecks {
|
||||
if pc != nil {
|
||||
nmd.PostureChecks[pc.ID] = twinPostureChecks(pc)
|
||||
nmd.PostureChecks[pc.ID] = TwinPostureChecks(pc)
|
||||
nmd.PostureCheckXIDToPublicID[pc.ID] = pc.PublicID
|
||||
}
|
||||
}
|
||||
@@ -391,7 +391,17 @@ func TwinNetwork(n *Network) *nmdata.Network {
|
||||
}
|
||||
}
|
||||
|
||||
func twinPostureChecks(pc *posture.Checks) *nmdata.PostureChecks {
|
||||
// TwinPostureChecksList converts posture checks to their slim nmdata twins.
|
||||
func TwinPostureChecksList(checks []*posture.Checks) []*nmdata.PostureChecks {
|
||||
out := make([]*nmdata.PostureChecks, 0, len(checks))
|
||||
for _, pc := range checks {
|
||||
out = append(out, TwinPostureChecks(pc))
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// TwinPostureChecks converts posture checks to their slim nmdata twin.
|
||||
func TwinPostureChecks(pc *posture.Checks) *nmdata.PostureChecks {
|
||||
if pc == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user