Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: l1b0k <[email protected]>
  • Loading branch information
l1b0k committed Nov 25, 2024
1 parent edd1d1b commit bbb8608
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugin/datapath/ipvlan_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func (d *IPvlanDriver) Setup(ctx context.Context, cfg *types.SetupConfig, netNS
if cfg.Egress == 0 && cfg.Ingress == 0 {
return nil
}
if cfg.BandwidthMode == "edt" {
if cfg.BandwidthMode == types.BandwidthModeEDT {
return ensureFQ(ctx, contLink)
}
return utils.SetupTC(contLink, cfg.Egress)
Expand Down
6 changes: 3 additions & 3 deletions plugin/datapath/policy_router_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func (d *PolicyRoute) Setup(ctx context.Context, cfg *types.SetupConfig, netNS n
return err
}

if cfg.BandwidthMode != "edt" && cfg.Egress > 0 {
if cfg.BandwidthMode != types.BandwidthModeEDT && cfg.Egress > 0 {
err = ensureMQ(ctx, eni)
if err != nil {
return err
Expand Down Expand Up @@ -348,7 +348,7 @@ func (d *PolicyRoute) Setup(ctx context.Context, cfg *types.SetupConfig, netNS n
if err != nil {
return err
}
if cfg.BandwidthMode != "edt" && cfg.Egress > 0 {
if cfg.BandwidthMode != types.BandwidthModeEDT && cfg.Egress > 0 {
return utils.SetupTC(contLink, cfg.Egress)
}
return nil
Expand Down Expand Up @@ -396,7 +396,7 @@ func (d *PolicyRoute) Setup(ctx context.Context, cfg *types.SetupConfig, netNS n
return fmt.Errorf("setup host veth config, %w", err)
}

if cfg.BandwidthMode != "edt" && cfg.Ingress > 0 {
if cfg.BandwidthMode != types.BandwidthModeEDT && cfg.Ingress > 0 {
return utils.SetupTC(hostVETH, cfg.Ingress)
}
return nil
Expand Down
5 changes: 5 additions & 0 deletions plugin/driver/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,8 @@ type TeardownCfg struct {

EnableNetworkPriority bool
}

const (
BandwidthModeEDT = "edt"
BandwidthModeTC = "tc"
)

0 comments on commit bbb8608

Please sign in to comment.