Skip to content

Commit

Permalink
Add info logs to egress
Browse files Browse the repository at this point in the history
Signed-off-by: Tomoki Sugiura <[email protected]>
  • Loading branch information
chez-shanpu committed Aug 2, 2024
1 parent 8cc7f90 commit ca263f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions v2/cmd/coil-egress/sub/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package sub

import (
"errors"
"fmt"
"net"
"os"
"strings"
Expand Down Expand Up @@ -89,21 +88,24 @@ func subMain() error {
return err
}

setupLog.Info("initialize FoU tunnel", "port", config.port, "ipv4", ipv4.String(), "ipv6", ipv6.String())
ft := founat.NewFoUTunnel(config.port, ipv4, ipv6, nil)
if err := ft.Init(); err != nil {
return err
}

setupLog.Info("initialize Egress", "ipv4", ipv4.String(), "ipv6", ipv6.String())
eg := founat.NewEgress("eth0", ipv4, ipv6)
if err := eg.Init(); err != nil {
return err
}

setupLog.Info("setup Pod watcher")
if err := controllers.SetupPodWatcher(mgr, myNS, myName, ft, config.enableSportAuto, eg, nil); err != nil {
return err
}

setupLog.Info(fmt.Sprintf("starting manager (version: %s)", v2.Version()))
setupLog.Info("starting manager", "version", v2.Version())
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
setupLog.Error(err, "problem running manager")
return err
Expand Down
2 changes: 2 additions & 0 deletions v2/controllers/pod_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ func (r *podWatcher) addPod(pod *corev1.Pod, logger logr.Logger) error {
r.mu.Lock()
defer r.mu.Unlock()

logger.Info("add pod", "pod", pod.Name, "namespace", pod.Namespace)

key := pod.Namespace + "/" + pod.Name
existing := r.podAddrs[key]
podIPs := make([]net.IP, len(pod.Status.PodIPs))
Expand Down

0 comments on commit ca263f3

Please sign in to comment.