@@ -22,12 +22,12 @@ import (
22
22
)
23
23
24
24
var (
25
- errMissingDataPathName = errors .New ("datapath name argument is mandatory" )
26
- errUninitializedClient = errors .New ("client unitialized" )
27
- errMissingMandatoryZone = errors .New ("at least 1 zone is mandatory" )
28
- errWrongArgumentNumber = errors .New ("missing or too much arguments to setup ct limits" )
29
- errWrongDefaultArgument = errors .New ("wrong argument while setting default ct limits" )
30
- errWrongZoneArgument = errors .New ("wrong argument while setting zone ct limits" )
25
+ errMissingMandatoryDataPathName = errors .New ("datapath name argument is mandatory" )
26
+ errUninitializedClient = errors .New ("client unitialized" )
27
+ errMissingMandatoryZone = errors .New ("at least 1 zone is mandatory" )
28
+ errWrongArgumentNumber = errors .New ("missing or too many arguments to setup ct limits" )
29
+ errWrongDefaultArgument = errors .New ("wrong argument while setting default ct limits" )
30
+ errWrongZoneArgument = errors .New ("wrong argument while setting zone ct limits" )
31
31
)
32
32
33
33
// Zone defines the type used to store a zone as it is returned
@@ -44,7 +44,7 @@ type Zone map[string]uint64
44
44
type ConnTrackOutput struct {
45
45
// defaulCT is used to store the global setting: default
46
46
defaultLimit Zone
47
- //zones stores all remaning zone's settings
47
+ // zones stores all remaning zone's settings
48
48
zones []Zone
49
49
}
50
50
@@ -78,10 +78,10 @@ type ConnTrackReader interface {
78
78
// ConnTrackWriter is the interface defining the write operations
79
79
// of ovs conntrack
80
80
type ConnTrackWriter interface {
81
- // SetCTLimits is the method used to setup a limit for an ofport ( zone)
81
+ // SetCTLimits is the method used to setup a limit for a zone
82
82
// belonging to a datapath of a switch
83
83
SetCTLimits (string ) (string , error )
84
- // DelCTLimits is the method used to remove a limit to an ofport ( zone)
84
+ // DelCTLimits is the method used to remove a limit to a zone
85
85
// belonging to a datapath of a switch
86
86
DelCTLimits (string , []uint64 ) (string , error )
87
87
}
@@ -152,7 +152,7 @@ func (dp *DataPathService) DelDataPath(dpName string) error {
152
152
func (dp * DataPathService ) GetCTLimits (dpName string , zones []uint64 ) (* ConnTrackOutput , error ) {
153
153
// Start by building the args
154
154
if dpName == "" {
155
- return nil , errMissingDataPathName
155
+ return nil , errMissingMandatoryDataPathName
156
156
}
157
157
158
158
args := []string {"ct-get-limits" , dpName }
@@ -215,7 +215,7 @@ func (dp *DataPathService) GetCTLimits(dpName string, zones []uint64) (*ConnTrac
215
215
func (dp * DataPathService ) SetCTLimits (dpName string , zone map [string ]uint64 ) (string , error ) {
216
216
// Sanitize the input
217
217
if dpName == "" {
218
- return "" , errMissingDataPathName
218
+ return "" , errMissingMandatoryDataPathName
219
219
}
220
220
argsStr , err := ctSetLimitsArgsToString (zone )
221
221
if err != nil {
@@ -233,7 +233,7 @@ func (dp *DataPathService) SetCTLimits(dpName string, zone map[string]uint64) (s
233
233
// sudo ovs-dpctl ct-del-limits system@ovs-system zone=40,4
234
234
func (dp * DataPathService ) DelCTLimits (dpName string , zones []uint64 ) (string , error ) {
235
235
if dpName == "" {
236
- return "" , errMissingDataPathName
236
+ return "" , errMissingMandatoryDataPathName
237
237
}
238
238
if len (zones ) < 1 {
239
239
return "" , errMissingMandatoryZone
@@ -253,7 +253,7 @@ func (dp *DataPathService) DelCTLimits(dpName string, zones []uint64) (string, e
253
253
return string (results ), err
254
254
}
255
255
256
- // ctSetLimitsArgsToString is function to help formating and sanatizing an input
256
+ // ctSetLimitsArgsToString helps formating and sanatizing an input
257
257
// It takes a map and output a string like this:
258
258
// - "zone=2,limit=10000" or "limit=10000,zone=2"
259
259
// - "default=10000"
0 commit comments