Skip to content

Commit

Permalink
Refactor TrafficManager windows files to clarify logs
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasferrandiz committed Apr 19, 2024
1 parent 2092b83 commit 5c96864
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
3 changes: 0 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,11 +561,8 @@ func ReadIP6CIDRsFromSubnetFile(path string, CIDRKey string) []ip.IP6Net {

func newTrafficManager(useNftables bool) trafficmngr.TrafficManager {
if useNftables {
log.Info("Starting flannel in nftables mode")
return &nftables.NFTablesManager{}
} else {
log.Info("Starting flannel in iptables mode")
return &iptables.IPTablesManager{}

}
}
2 changes: 2 additions & 0 deletions pkg/trafficmngr/iptables/iptables.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ type IPTablesManager struct {
}

func (iptm *IPTablesManager) Init(ctx context.Context, wg *sync.WaitGroup) error {
log.Info("Starting flannel in iptables mode...")

iptm.ipv4Rules = make([]trafficmngr.IPTablesRule, 0, 10)
iptm.ipv6Rules = make([]trafficmngr.IPTablesRule, 0, 10)
wg.Add(1)
Expand Down
2 changes: 1 addition & 1 deletion pkg/trafficmngr/iptables/iptables_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type IPTables interface {
}

func (iptm IPTablesManager) Init(ctx context.Context, wg *sync.WaitGroup) error {
log.Warning(trafficmngr.ErrUnimplemented)
log.Info("Starting flannel in windows mode...")
return nil
}

Expand Down
1 change: 1 addition & 0 deletions pkg/trafficmngr/nftables/nftables.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type NFTablesManager struct {
}

func (nftm *NFTablesManager) Init(ctx context.Context, wg *sync.WaitGroup) error {
log.Info("Starting flannel in nftables mode...")
var err error
nftm.nftv4, err = initTable(ctx, knftables.IPv4Family, ipv4Table)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/trafficmngr/nftables/nftables_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type NFTablesManager struct {
}

func (nftm *NFTablesManager) Init(ctx context.Context, wg *sync.WaitGroup) error {
log.Warning(trafficmngr.ErrUnimplemented)
log.Info("Starting flannel in windows mode...")
return nil
}

Expand Down

0 comments on commit 5c96864

Please sign in to comment.