NM-278: skip autoupdate evaluation on join (#3922)

This commit is contained in:
Abhishek Kondur
2026-03-19 07:58:36 +05:30
committed by GitHub
parent 99cb0ae6b3
commit 2645abdd43
4 changed files with 14 additions and 13 deletions
+1 -1
View File
@@ -382,7 +382,7 @@ func handleHostRegister(w http.ResponseWriter, r *http.Request) {
OSFamily: newHost.OSFamily,
OSVersion: newHost.OSVersion,
KernelVersion: newHost.KernelVersion,
AutoUpdate: newHost.AutoUpdate,
SkipAutoUpdate: true,
Tags: keyTags,
}, schema.NetworkID(netI))
pcviolations = append(pcviolations, violations...)
+1 -1
View File
@@ -695,7 +695,7 @@ func addHostToNetwork(w http.ResponseWriter, r *http.Request) {
OSFamily: currHost.OSFamily,
OSVersion: currHost.OSVersion,
KernelVersion: currHost.KernelVersion,
AutoUpdate: currHost.AutoUpdate,
SkipAutoUpdate: true,
}, schema.NetworkID(network))
if len(violations) > 0 {
logic.ReturnErrorResponseWithJson(w, r, violations, logic.FormatError(errors.New("posture check violations"), logic.BadReq))
+11 -10
View File
@@ -472,16 +472,17 @@ type IDPSyncTestRequest struct {
}
type PostureCheckDeviceInfo struct {
ClientLocation string
ClientVersion string
OS string
OSFamily string
OSVersion string
KernelVersion string
AutoUpdate bool
Tags map[TagID]struct{}
IsUser bool
UserGroups map[schema.UserGroupID]struct{}
ClientLocation string
ClientVersion string
OS string
OSFamily string
OSVersion string
KernelVersion string
AutoUpdate bool
SkipAutoUpdate bool
Tags map[TagID]struct{}
IsUser bool
UserGroups map[schema.UserGroupID]struct{}
}
type Violation struct {
+1 -1
View File
@@ -133,7 +133,7 @@ func GetPostureCheckViolations(checks []schema.PostureCheck, d models.PostureChe
if !c.Status {
continue
}
if d.IsUser && c.Attribute == schema.AutoUpdate {
if c.Attribute == schema.AutoUpdate && (d.IsUser || d.SkipAutoUpdate) {
continue
}
// Check if tags match