Skip to content

Commit db299d2

Browse files
committed
core: (unorchestratedUpdates) update alert and throttling configs with other dynamic configs
Signed-off-by: tesla59 <[email protected]>
1 parent 6ba254b commit db299d2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

KubeArmor/config/config.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,6 @@ func LoadConfig() error {
299299

300300
GlobalCfg.StateAgent = viper.GetBool(ConfigStateAgent)
301301

302-
GlobalCfg.AlertThrottling = viper.GetBool(ConfigAlertThrottling)
303-
GlobalCfg.MaxAlertPerSec = viper.GetInt(ConfigMaxAlertPerSec)
304-
GlobalCfg.ThrottleSec = viper.GetInt(ConfigThrottleSec)
305302
GlobalCfg.AnnotateResources = viper.GetBool(ConfigAnnotateResources)
306303

307304
LoadDynamicConfig()
@@ -331,4 +328,8 @@ func LoadDynamicConfig() {
331328
GlobalCfg.HostVisibility = "none"
332329
}
333330
}
331+
332+
GlobalCfg.AlertThrottling = viper.GetBool(ConfigAlertThrottling)
333+
GlobalCfg.MaxAlertPerSec = viper.GetInt(ConfigMaxAlertPerSec)
334+
GlobalCfg.ThrottleSec = viper.GetInt(ConfigThrottleSec)
334335
}

KubeArmor/core/unorchestratedUpdates.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ func (dm *KubeArmorDaemon) WatchConfigChanges() {
6464
Capabilities: dm.validateVisibility("capabilities", cfg.GlobalCfg.Visibility),
6565
}
6666

67-
// Log the current global posture and visibility
68-
dm.Logger.Printf("Updating Global Posture to %v", globalPosture)
69-
dm.Logger.Printf("Updating Visibility to %v", visibility)
70-
7167
// Apply the changes to the daemon
7268
dm.UpdateGlobalPosture(globalPosture)
7369

@@ -77,6 +73,9 @@ func (dm *KubeArmorDaemon) WatchConfigChanges() {
7773
dm.UpdateDefaultPosture("MODIFIED", ep.NamespaceName, globalPosture, false)
7874
dm.UpdateVisibility("MODIFIED", ep.NamespaceName, visibility)
7975
}
76+
77+
// Update throttling configs
78+
dm.SystemMonitor.UpdateThrottlingConfig()
8079
})
8180
viper.WatchConfig()
8281
}

0 commit comments

Comments
 (0)