Skip to content

Commit

Permalink
Log Flow Aggregator version on start (#6581)
Browse files Browse the repository at this point in the history
Make Start / Stop log messages consistent across Antrea programs.

Signed-off-by: Antonin Bas <[email protected]>
  • Loading branch information
antoninbas committed Aug 5, 2024
1 parent 167b728 commit 29f947c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/antrea-agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ var ipv4Localhost = net.ParseIP("127.0.0.1")

// run starts Antrea agent with the given options and waits for termination signal.
func run(o *Options) error {
klog.InfoS("Starting Antrea agent", "version", version.GetFullVersion())
klog.InfoS("Starting Antrea Agent", "version", version.GetFullVersion())

// Create K8s Clientset, CRD Clientset, Multicluster CRD Clientset and SharedInformerFactory for the given config.
k8sClient, _, crdClient, _, mcClient, _, err := k8s.CreateClients(o.config.ClientConnection, o.config.KubeAPIServerOverride)
Expand Down Expand Up @@ -995,6 +995,6 @@ func run(o *Options) error {
}

<-stopCh
klog.Info("Stopping Antrea agent")
klog.InfoS("Stopping Antrea Agent")
return nil
}
4 changes: 2 additions & 2 deletions cmd/antrea-controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ var allowedPaths = []string{

// run starts Antrea Controller with the given options and waits for termination signal.
func run(o *Options) error {
klog.Infof("Starting Antrea Controller (version %s)", version.GetFullVersion())
klog.InfoS("Starting Antrea Controller", "version", version.GetFullVersion())
// Create K8s Clientset, Aggregator Clientset, CRD Clientset and SharedInformerFactory for the given config.
// Aggregator Clientset is used to update the CABundle of the APIServices backed by antrea-controller so that
// the aggregator can verify its serving certificate.
Expand Down Expand Up @@ -434,7 +434,7 @@ func run(o *Options) error {
}

<-stopCh
klog.Info("Stopping Antrea controller")
klog.InfoS("Stopping Antrea Controller")
return nil
}

Expand Down
5 changes: 3 additions & 2 deletions cmd/flow-aggregator/flow-aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ import (
"antrea.io/antrea/pkg/signals"
"antrea.io/antrea/pkg/util/cipher"
"antrea.io/antrea/pkg/util/podstore"
"antrea.io/antrea/pkg/version"
)

const informerDefaultResync = 12 * time.Hour

func run(configFile string) error {
klog.Infof("Flow aggregator starting...")
klog.InfoS("Starting Flow Aggregator", "version", version.GetFullVersion())
// Set up signal capture: the first SIGTERM / SIGINT signal is handled gracefully and will
// cause the stopCh channel to be closed; if another signal is received before the program
// exits, we will force exit.
Expand Down Expand Up @@ -85,7 +86,7 @@ func run(configFile string) error {
informerFactory.Start(stopCh)

<-stopCh
klog.InfoS("Stopping flow aggregator")
klog.InfoS("Stopping Flow Aggregator")
wg.Wait()
return nil
}
Expand Down

0 comments on commit 29f947c

Please sign in to comment.