From 7d40189c4288b73b3fb5edd35b53357014fb6b55 Mon Sep 17 00:00:00 2001 From: Srikar Tati Date: Mon, 2 Aug 2021 10:00:12 -0700 Subject: [PATCH] Log maintenance bug fix in the Flow Aggregator Periodic deletion of log files is missing in the Flow Aggreegator. This logic periodically deletes extra files by making sure that max number of files to be 4. This will ensure that no disk space is wasted on the Kubernetes node running the Flow Aggregator. This logic was missed initially when the logging in the Flow Aggregator is added in the beginning adopting the same framework as the Antrea Agent and the Antrea Controller. Signed-off-by: Srikar Tati --- cmd/flow-aggregator/flow-aggregator.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/flow-aggregator/flow-aggregator.go b/cmd/flow-aggregator/flow-aggregator.go index 1438182546a..bfc04ea8d9c 100644 --- a/cmd/flow-aggregator/flow-aggregator.go +++ b/cmd/flow-aggregator/flow-aggregator.go @@ -28,6 +28,7 @@ import ( "antrea.io/antrea/pkg/clusteridentity" aggregator "antrea.io/antrea/pkg/flowaggregator" + "antrea.io/antrea/pkg/log" "antrea.io/antrea/pkg/signals" ) @@ -77,6 +78,8 @@ func run(o *Options) error { // exits, we will force exit. stopCh := signals.RegisterSignalHandlers() + log.StartLogFileNumberMonitor(stopCh) + k8sClient, err := createK8sClient() if err != nil { return fmt.Errorf("error when creating K8s client: %v", err)