mirror of
https://github.com/gravitl/netmaker.git
synced 2026-04-22 16:07:11 +08:00
NM-278: skip autoupdate evaluation on join (#3922)
This commit is contained in:
@@ -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...)
|
||||
|
||||
@@ -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
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user