@@ -33,7 +33,7 @@ import (
33
33
"k8s.io/klog"
34
34
)
35
35
36
- // tcShaper provides an implementation of the BandwidthShaper interface on Linux using the 'tc' tool.
36
+ // tcShaper provides an implementation of the Shaper interface on Linux using the 'tc' tool.
37
37
// In general, using this requires that the caller posses the NET_CAP_ADMIN capability, though if you
38
38
// do this within an container, it only requires the NS_CAPABLE capability for manipulations to that
39
39
// container's network namespace.
@@ -44,7 +44,8 @@ type tcShaper struct {
44
44
iface string
45
45
}
46
46
47
- func NewTCShaper (iface string ) BandwidthShaper {
47
+ // NewTCShaper makes a new tcShaper for the given interface
48
+ func NewTCShaper (iface string ) Shaper {
48
49
shaper := & tcShaper {
49
50
e : exec .New (),
50
51
iface : iface ,
@@ -157,10 +158,9 @@ func (t *tcShaper) findCIDRClass(cidr string) (classAndHandleList [][]string, fo
157
158
// filter parent 1: protocol ip pref 1 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1
158
159
if len (parts ) != 19 {
159
160
return classAndHandleList , false , fmt .Errorf ("unexpected output from tc: %s %d (%v)" , filter , len (parts ), parts )
160
- } else {
161
- resultTmp := []string {parts [18 ], parts [9 ]}
162
- classAndHandleList = append (classAndHandleList , resultTmp )
163
161
}
162
+ resultTmp := []string {parts [18 ], parts [9 ]}
163
+ classAndHandleList = append (classAndHandleList , resultTmp )
164
164
}
165
165
}
166
166
if len (classAndHandleList ) > 0 {
0 commit comments